Bonjour,
Je travaille sous PyCharm, j'ai Python 3.7, et j'essaie d'installer tensorflow.
J'ai vu ici qu'il faut installer la version 1.13.1.
L'installation se fait sans erreur, mais lorsque je lance ce code :
1 2 3 4 5 6 7 8 9 10 11
| import tensorflow as tf
if __name__ == '__main__':
print("TensorFlow")
x = tf.constant([[1., 2., 3.],
[4., 5., 6.]])
print(x)
print(x.shape)
print(x.dtype) |
J'ai l'erreur :
AttributeError: module 'tensorflow' has no attribute 'constant'
Dans le code, l'instruction import tensorflow apparait souligné avec le message :
1 2
| This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases.
Top-level and class-level items are supported better than instance items. |
Qu'est ce qui cloche?
Merci,
Nico
Partager