error

56 views
Skip to first unread message

Sylvain Ard

unread,
Jan 14, 2021, 5:00:11 PM1/14/21
to Keras-users

Hello,
I have this error :
yarl @ file:///tmp/build/80754af9/yarl_1606939915466/work
zipp @ file:///tmp/build/80754af9/zipp_1604001098328/work
Traceback (most recent call last):
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
  File "/home/reveries/anaconda3/envs/semantic2/lib-python/3/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/keras/__init__.py", line 3, in <module>
    from tensorflow.keras.layers.experimental.preprocessing import RandomRotation
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/python/__init__.py", line 50, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/python/pywrap_tensorflow.py", line 69, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
  File "/home/reveries/anaconda3/envs/semantic2/lib-python/3/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/reveries/programmes/Valery_Malecot_opencv4/test_img_petioles.py", line 10, in <module>
    from keras.layers import Conv2D, MaxPooling2D, Activation, Dropout, Flatten, BatchNormalization
  File "/home/reveries/anaconda3/envs/semantic2/site-packages/keras/__init__.py", line 6, in <module>
    'Keras requires TensorFlow 2.2 or higher. '
ImportError: Keras requires TensorFlow 2.2 or higher. Install TensorFlow via `pip install tensorflow`

this is my conda list :
(semantic2) reveries@reveries-feuilles:~/programmes/Valery_Malecot_opencv4$ conda list
# packages in environment at /home/reveries/anaconda3/envs/semantic2:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
_tflow_select             2.3.0                       mkl
absl-py                   0.11.0             pyhd3eb1b0_1
aiohttp                   3.6.3            py36h7b6447c_0
astor                     0.8.1                    pypi_0    pypi
astunparse                1.6.3                      py_0
async-timeout             3.0.1                    py36_0
attrs                     20.3.0             pyhd3eb1b0_0
blas                      1.0                         mkl
blinker                   1.4                      py36_0
brotlipy                  0.7.0           py36h27cfd23_1003
bzip2                     1.0.8                h7b6447c_0
c-ares                    1.17.1               h27cfd23_0
ca-certificates           2020.12.8            h06a4308_0
cachetools                4.2.0              pyhd3eb1b0_0
cairo                     1.16.0            h7979940_1007    conda-forge
certifi                   2020.12.5        py36h06a4308_0
cffi                      1.14.4           py36h261ae71_0
chardet                   3.0.4           py36h06a4308_1003
click                     7.1.2                      py_0
cryptography              3.3.1            py36h3c74f83_0
dbus                      1.13.18              hb2f20db_0
expat                     2.2.10               he6710b0_2
ffmpeg                    4.3.1                hca11adc_2    conda-forge
fontconfig                2.13.1            hba837de_1004    conda-forge
freetype                  2.10.4               h5ab3b9f_0
gast                      0.2.2                    pypi_0    pypi
gdbm                      1.18                 h0a1914f_2    conda-forge
gettext                   0.19.8.1             h9b4dc7a_1
glib                      2.66.4               hcd2ae1e_1    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gnutls                    3.6.13               h85f3911_1    conda-forge
google-auth               1.24.0             pyhd3eb1b0_0
google-auth-oauthlib      0.4.2              pyhd3eb1b0_2
google-pasta              0.2.0                      py_0
graphite2                 1.3.14               h23475e2_0
grpcio                    1.31.0           py36hf8bcb03_0
gst-plugins-base          1.14.5               h0935bb2_2    conda-forge
gstreamer                 1.18.3               h3560a44_0    conda-forge
h5py                      2.10.0           py36hd6299e0_1
harfbuzz                  2.7.4                h5cf4720_0    conda-forge
hdf5                      1.10.6               hb1b8bf9_0
icu                       68.1                 h58526e2_0    conda-forge
idna                      2.10                       py_0
idna_ssl                  1.1.0                    py36_0
importlib-metadata        2.0.0                      py_1
intel-openmp              2020.2                      254
jasper                    1.900.1              hd497a04_4
joblib                    1.0.0                    pypi_0    pypi
jpeg                      9d                   h36c2ea0_0    conda-forge
keras                     2.4.3                         0
keras-applications        1.0.8                    pypi_0    pypi
keras-base                2.4.3                      py_0
keras-preprocessing       1.1.0                      py_1
krb5                      1.17.1               h173b8e3_0
lame                      3.100                h7b6447c_0
libblas                   3.8.0                    21_mkl    conda-forge
libcblas                  3.8.0                    21_mkl    conda-forge
libclang                  11.0.0          default_ha5c780c_2    conda-forge
libedit                   3.1.20191231         h14c3975_1
libevent                  2.1.10               hcdb4288_3    conda-forge
libffi                    3.3                  he6710b0_2
libgcc-ng                 9.3.0               h5dbcf3e_17    conda-forge
libgfortran-ng            7.3.0                hdf63c60_0
libglib                   2.66.4               h164308a_1    conda-forge
libgomp                   9.3.0               h5dbcf3e_17    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.8.0                    21_mkl    conda-forge
liblapacke                3.8.0                    21_mkl    conda-forge
libllvm11                 11.0.1               hf817b99_0    conda-forge
libopencv                 4.4.0                    py36_3    conda-forge
libpng                    1.6.37               hbc83047_0
libpq                     12.3                 h255efa7_3    conda-forge
libprotobuf               3.13.0.1             hd408876_0
libstdcxx-ng              9.3.0               h2ae2ef3_17    conda-forge
libtiff                   4.1.0                h2733197_1
libuuid                   2.32.1            h7f98852_1000    conda-forge
libwebp-base              1.1.0                h7b6447c_3
libxcb                    1.14                 h7b6447c_0
libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
libxml2                   2.9.10               h72842e0_3    conda-forge
lz4-c                     1.9.2                heb0550a_3
markdown                  3.3.3            py36h06a4308_0
mkl                       2020.2                      256
mkl-service               2.3.0            py36he8ac12f_0
mkl_fft                   1.2.0            py36h23d657b_0
mkl_random                1.1.1            py36h0573a6f_0
multidict                 4.7.6            py36h7b6447c_1
mysql-common              8.0.22               ha770c72_1    conda-forge
mysql-libs                8.0.22               h1fd7589_1    conda-forge
ncurses                   6.2                  he6710b0_1
nettle                    3.6                  he412f7d_0    conda-forge
nspr                      4.29                 h9c3ff4c_1    conda-forge
nss                       3.60                 hb5efdd6_0    conda-forge
numpy                     1.19.5                   pypi_0    pypi
numpy-base                1.19.2           py36hfa32c7d_0
oauthlib                  3.1.0                      py_0
opencv                    4.4.0                    py36_3    conda-forge
openh264                  2.1.1                h780b84a_0    conda-forge
openssl                   1.1.1i               h27cfd23_0
opt_einsum                3.1.0                      py_0
pandas                    1.1.2                    pypi_0    pypi
pcre                      8.44                 he6710b0_0
pip                       20.3.3           py36h06a4308_0
pixman                    0.40.0               h7b6447c_0
protobuf                  3.13.0.1         py36he6710b0_1
py-opencv                 4.4.0            py36h0b673f9_3    conda-forge
pyasn1                    0.4.8                      py_0
pyasn1-modules            0.2.8                      py_0
pycparser                 2.20                       py_2
pyjwt                     1.7.1                    py36_0
pyopenssl                 20.0.1             pyhd3eb1b0_1
pypy3.6                   7.3.3                he1ebe50_3    conda-forge
pysocks                   1.7.1            py36h06a4308_0
python                    3.6.12                5_73_pypy    conda-forge
python-dateutil           2.8.1                      py_0
python_abi                3.6               1_pypy36_pp73    conda-forge
pytz                      2020.5             pyhd3eb1b0_0
pyyaml                    5.3.1            py36h7b6447c_1
qt                        5.12.9               h9d6b050_2    conda-forge
readline                  8.0                  h7b6447c_0
requests                  2.25.1             pyhd3eb1b0_0
requests-oauthlib         1.3.0                      py_0
rsa                       4.7                pyhd3eb1b0_1
scikit-learn              0.23.2                   pypi_0    pypi
scipy                     1.4.1                    pypi_0    pypi
setuptools                51.1.2           py36h06a4308_4
six                       1.15.0           py36h06a4308_0
sqlite                    3.34.0               h74cdb3f_0    conda-forge
tensorboard               2.2.1                    pypi_0    pypi
tensorboard-plugin-wit    1.6.0                      py_0
tensorflow                2.2.0           mkl_py36h5a57954_0
tensorflow-base           2.2.0           mkl_py36hd506778_0
tensorflow-estimator      2.0.1                    pypi_0    pypi
termcolor                 1.1.0                    py36_1
threadpoolctl             2.1.0                    pypi_0    pypi
tk                        8.6.10               hbc83047_0
typing_extensions         3.7.4.3                    py_0
urllib3                   1.26.2             pyhd3eb1b0_0
werkzeug                  1.0.1                      py_0
wheel                     0.36.2             pyhd3eb1b0_0
wrapt                     1.12.1           py36h7b6447c_1
x264                      1!161.3030           h7f98852_0    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h516909a_0    conda-forge
xorg-libsm                1.2.3             h84519dc_1000    conda-forge
xorg-libx11               1.6.12               h516909a_0    conda-forge
xorg-libxext              1.3.4                h516909a_0    conda-forge
xorg-libxrender           0.9.10            h516909a_1002    conda-forge
xorg-renderproto          0.11.1            h14c3975_1002    conda-forge
xorg-xextproto            7.3.0             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h27cfd23_1007
xz                        5.2.5                h7b6447c_0
yaml                      0.2.5                h7b6447c_0
yarl                      1.6.3            py36h27cfd23_0
zipp                      3.4.0              pyhd3eb1b0_0
zlib                      1.2.11               h7b6447c_3
zstd                      1.4.5                h9ceee32_0

Lance Norskog

unread,
Jan 15, 2021, 12:35:41 AM1/15/21
to Sylvain Ard, Keras-users
According to this, the Tensorflow 2.2.x series has releases numbered 2.2.0, 2.2.1 and 2.2.2. If you upgrade just TF in place to 2.2.2, that might fix this without disrupting other parts of the "version web".


--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/cdd16d2f-de5b-4dcd-a070-e0442a94dd63n%40googlegroups.com.


--
Lance Norskog
lance....@gmail.com
Redwood City, CA

Matias Valdenegro

unread,
Jan 15, 2021, 1:57:55 AM1/15/21
to keras...@googlegroups.com

No, this is just a (bad) guess of a solution, the problem is clearly here:


> ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'


This means your TF install is completely broken, reinstall tensorflow.

| > ywrap_tensorflow_internal.py", line 20, in swig_import_helper

Sylvain Ard

unread,
Jan 15, 2021, 4:56:35 AM1/15/21
to Keras-users
I tried to install tensorflow 2.2.2 but I get the error :

(semantic2) reveries@reveries-feuilles:~$ conda install tensorflow=2.2.2        Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - tensorflow=2.2.2

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

I tried to reinstall tensorflow but same error

Sylvain Ard

unread,
Jan 15, 2021, 5:00:09 AM1/15/21
to Keras-users
I tried to remove the environment and recreate it but same error

Lance Norskog

unread,
Jan 15, 2021, 10:03:16 PM1/15/21
to Sylvain Ard, Keras-users
It looks like the Anaconda package set might have a broken install or a mismatched set of packages.
At this point I would start from an empty, fresh Python environment and install only the packages I needed.




Reply all
Reply to author
Forward
0 new messages