FIX: Input 'y' of 'Sub' Op has type float16 that does not match type float32 of argument 'x'. #82
Replies: 3 comments 6 replies
-
Thank you for sharing brother! I'll add this to the course content. PS the main place this will happen is for Notebook 07 - Milestone Project 1: Food Vision when we use |
Beta Was this translation helpful? Give feedback.
-
I wrote a note about this on the ZTM/Udemy versions of the course, putting it here for reference. It comes just before the mixed precision video for Notebook 07 - Milestone Project 1: Food Vision. Hey there, Just putting this note here to let you know that you may face an error in the next video if you're using TensorFlow 2.5+. ErrorThe error happens when you turn on mixed precision training for EfficientNetBX models (if you're not sure what this is, you'll see it in the next video). It'll look something like this:
As of 29 May 2021 it looks like this is a bug in TensorFlow 2.5+. There is an issue thread tracking the progress of an update on GitHub: tensorflow/tensorflow#49725 How to fix itThe current workaround is to downgrade to TensorFlow 2.4.1 (the last version before 2.5). You can do this in Google Colab by running:
After doing so, you'll have to restart your runtime (Runtime -> Restart runtime) to ensure TensorFlow 2.4.1 is active.
Once TensorFlow 2.4.1 is installed, the code should work as normal. If you have any issues, please post your question/reply below so others can see. If a fix for this issue comes for TensorFlow 2.5+ (it should), we'll update this post. Happy mixed precision training,
|
Beta Was this translation helpful? Give feedback.
-
Also running into a problem. It appears that the ETA for fitting the model after downgrading to 2.4.1 is running at like 100 hours even with using the Nvida T4. Even running the project directly from github https://github.com/mrdbourke/tensorflow-deep-learning/blob/main/07_food_vision_milestone_project_1.ipynb it still is getting 100+ hours Saving TensorBoard log files to: training_logs/efficientnetb0_101_classes_all_data_feature_extract/20221227-085937 Tue Dec 27 08:59:33 2022 +-----------------------------------------------------------------------------+ Turn on mixed precision trainingfrom tensorflow.keras import mixed_precision WARNING:tensorflow:Mixed precision compatibility check (mixed_float16): WARNING |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Temporary Fix
This seems like a bug with the latest version of TensorFlow (2.5.0). In case if you guys want to monitor the thread check this link.
For now, there is a temporary fix for this that is to downgrade your TensorFlow version to 2.4.1 to avoid this error. We should stick with this for the time being till the developers in TensorFlow find a way to fix this.
Beta Was this translation helpful? Give feedback.
All reactions