Error Message "AttributeError: 'NoneType' object has no attribute 'dtype'" Displayed in Logs
Symptom
Code can run properly in the notebook Keras image. When tensorflow.keras is used for training, error message "AttributeError: 'NoneType' object has no attribute 'dtype'" is displayed.
Possible Causes
The NumPy version of the training image is different from that in the notebook instance.
Solution
Print the NumPy version in the code and check whether the version is 1.18.5. If the version is not 1.18.5, run the following command at the beginning of the code:
import os os.system('pip install numpy==1.18.5')
If the error persists, modify the preceding code as follows:
import os os.system('pip install numpy==1.18.5') os.system('pip install keras==2.6.0') os.system('pip install tensorflow==2.6.0')
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot