Cette page n'est pas encore disponible dans votre langue. Nous nous efforçons d'ajouter d'autres langues. Nous vous remercions de votre compréhension.

On this page
Help Center/ ModelArts/ Troubleshooting/ Training Jobs/ Service Code Issues/ Error Message "AttributeError: 'NoneType' object has no attribute 'dtype'" Displayed in Logs

Error Message "AttributeError: 'NoneType' object has no attribute 'dtype'" Displayed in Logs

Updated on 2024-06-11 GMT+08:00

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

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback