Giter Site home page Giter Site logo

codebasics / potato-disease-classification Goto Github PK

View Code? Open in Web Editor NEW
217.0 7.0 242.0 29.96 MB

Potato Disease Classification - Training, Rest APIs, and Frontend to test.

Python 0.07% Shell 0.01% HTML 0.02% JavaScript 0.19% CSS 0.01% Jupyter Notebook 98.54% PureBasic 1.05% Starlark 0.02% Java 0.06% Ruby 0.01% Objective-C 0.04%
deep-learning cnn-keras cnn-classification tensorflow2 keras keras-tensorflow tensorflow tensorflow-serving convolutional-neural-networks python3

potato-disease-classification's People

Contributors

dhavalsays avatar groverkds avatar karandeep-atliq avatar krinish-atliq avatar krinish291 avatar sahil-vasava-atliq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

potato-disease-classification's Issues

ValueError: Exception encountered when calling layer "random_flip" (type RandomFlip).

2023-02-06 23:05:44.031991: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "C:\Users\rudra\OneDrive\Desktop\Projects\potato-disease-classification-main\api\main.py", line 24, in
MODEL = tf.keras.models.load_model("../saved_models/1")
File "C:\Users\rudra\OneDrive\Desktop\Projects\potato-disease-classification-main\api\env\lib\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Users\rudra\OneDrive\Desktop\Projects\potato-disease-classification-main\api\env\lib\site-packages\keras\saving\legacy\saved_model\load.py", line 1015, in _unable_to_call_layer_due_to_serialization_issue
raise ValueError(
ValueError: Exception encountered when calling layer "random_flip" (type RandomFlip).

Cannot call custom layer random_flip of type <class 'keras.saving.legacy.saved_model.load.RandomFlip'>, because the call function was not serialized to the SavedModel.Please try one of the following methods to fix this issue:

(1) Implement get_config and from_config in the layer/model class, and pass the object to the custom_objects argument when loading the model. For more details, see: https://www.tensorflow.org/guide/keras/save_and_serialize

(2) Ensure that the subclassed model or layer overwrites call and not __call__. The input shape and dtype will be automatically recorded when the object is called, and used when saving. To manually specify the input shape/dtype, decorate the call function with @tf.function(input_signature=...).

Call arguments received by layer "random_flip" (type RandomFlip):
• unused_args=('tf.Tensor(shape=(None, 256, 256, 3), dtype=float32)',)
• unused_kwargs={'training': 'None'}

my libs
tensorflow 2.11.0
tensorflow-estimator 2.11.0
tensorflow-intel 2.11.0
tensorflow-io-gcs-filesystem 0.30.0
tensorflow-serving-api 2.11.0
urllib3 1.26.14
uvicorn 0.20.0

images_batch error message

Error on this notebook:
potato-disease-classification-model-using-image-data-generator.ipynb

The line:
batch_prediction = model.predict(images_batch)

Getting an error on this line.
images_batch was never defined (misspelling?).

That cell has to be removed.
If you want to keep it alive, need following lines:

first_image = image_batch[0]
first_label = np.argmax(label_batch[0])

plt.imshow(first_image)

img_array = tf.keras.preprocessing.image.img_to_array(first_image)
img_array = tf.expand_dims(img_array, 0)
predictions = model.predict(img_array)
predicted_class = class_names[np.argmax(predictions[0])]

ValueError when drag &drop a pic of different dimension

If we drag and drop a picture of different dimension other than (256 , 256) it shows "value error" of expected shape and found shape.
As I have made changes in main.py of api folder to resolve this bug, so please kindly review the PR #10

Typing mistake

Sir, in line 3 images[i].numpy() should be img

def predict(model, img):
img_array =
3 tf.keras.preprocessing.image.img_to_array(images[i].numpy())
img_array = tf.expand_dims(img_array, 0)

predictions = model.predict(img_array)

predicted_class = class_names[np.argmax(predictions[0])]
confidence = round(100 * (np.max(predictions[0])), 2)
return predicted_class, confidence

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.