-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can not import tensorflow package #16
Comments
Im having this error as well. On further checking I noticed the following :
Therefore, I had h5py installed:
I did not install numpy since it was a part of "tensorflow-deps". But the issue still exists. |
Okay so I was able to re-create this issue and resolve it successfully. The steps are more or less the same, except for few : Download the command line installer from 64-Bit (M1) Command Line Installer (565 MB)
Next Step : If error throws up, then try :
Next Steps :
RESULTS `(base) pradivgnanaraj@Pradivs-MacBook-Air ~ % python
`>>> import tensorflow as tf
`>>> tf.config.list_physical_devices("GPU")
Hope this helps |
RuntimeError Traceback (most recent call last)
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf
ImportError Traceback (most recent call last)
ImportError: numpy.core.multiarray failed to import
The above exception was the direct cause of the following exception:
SystemError Traceback (most recent call last)
SystemError: <built-in method contains of dict object at 0x138a8b6c0> returned a result with an error set
The above exception was the direct cause of the following exception:
ImportError Traceback (most recent call last)
Cell In[18], line 1
----> 1 import tensorflow as tf
2 print('done')
5 # Check for TensorFlow GPU access
File ~/tensorflow-test/env/lib/python3.8/site-packages/tensorflow/init.py:37
34 import sys as _sys
35 import typing as _typing
---> 37 from tensorflow.python.tools import module_util as _module_util
38 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
40 # Make sure code inside the TensorFlow codebase can use tf2.enabled() at import.
File ~/tensorflow-test/env/lib/python3.8/site-packages/tensorflow/python/init.py:37
29 # We aim to keep this file minimal and ideally remove completely.
30 # If you are adding a new file with @tf_export decorators,
31 # import it in modules_with_exports.py instead.
32
33 # go/tf-wildcard-import
34 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
36 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
---> 37 from tensorflow.python.eager import context
39 # pylint: enable=wildcard-import
40
41 # Bring in subpackages.
42 from tensorflow.python import data
File ~/tensorflow-test/env/lib/python3.8/site-packages/tensorflow/python/eager/context.py:33
31 from tensorflow.python import pywrap_tfe
32 from tensorflow.python import tf2
---> 33 from tensorflow.python.client import pywrap_tf_session
34 from tensorflow.python.eager import executor
35 from tensorflow.python.eager import monitoring
File ~/tensorflow-test/env/lib/python3.8/site-packages/tensorflow/python/client/pywrap_tf_session.py:19
17 # pylint: disable=invalid-import-order,g-bad-import-order, wildcard-import, unused-import
18 from tensorflow.python import pywrap_tensorflow
---> 19 from tensorflow.python.client._pywrap_tf_session import *
20 from tensorflow.python.client._pywrap_tf_session import _TF_SetTarget
21 from tensorflow.python.client._pywrap_tf_session import _TF_SetConfig
ImportError: initialization failed
The text was updated successfully, but these errors were encountered: