codebasics / potato-disease-classification Goto Github PK
View Code? Open in Web Editor NEWPotato Disease Classification - Training, Rest APIs, and Frontend to test.
Potato Disease Classification - Training, Rest APIs, and Frontend to test.
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
when i upload even a meme image , it is classifying as healthy.
The user interface works fine but when i try to drag and drop the image the backend is not responding
When it comes to Model Deployment To GCP. As user inputs, even meme images are giving output with 70% plus accuracy.
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])]
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.