Encrypted_Traffic_Classification icon indicating copy to clipboard operation
Encrypted_Traffic_Classification copied to clipboard

环境配置问题

Open LongyuanCode opened this issue 4 years ago • 1 comments

您好,想请问该项目的tensorflow版本是什么,我在配置运行环境的时候会提示import keras处有问题,AttributeError: module 'tensorflow._api.v1.compat.v2' has no attribute '__internal__'AttributeError: module 'tensorflow._api.v1.compat.v2' has no attribute '__internal__'

另外,适用于tensoflow的依赖(keras-applications 1.0.8、keras-preprocessing 1.1.2)和keras 2.2.0的依赖有冲突 ERROR: keras 2.2.0 has requirement keras-applications==1.0.2, but you'll have keras-applications 1.0.8 which is incompatible. ERROR: keras 2.2.0 has requirement keras-preprocessing==1.0.1, but you'll have keras-preprocessing 1.1.2 which is incompatible.

在多次修改我的虚拟运行环境后,我最后的虚拟环境如下

Package                 Version            
----------------------- -------------------
absl-py                 0.12.0             
astor                   0.8.1              
astunparse              1.6.3              
cached-property         1.5.2              
cachetools              4.2.2              
certifi                 2020.12.5          
chardet                 4.0.0              
cycler                  0.10.0             
flatbuffers             1.12               
gast                    0.2.2              
google-auth             1.30.1             
google-auth-oauthlib    0.4.4              
google-pasta            0.2.0              
grpcio                  1.34.1             
h5py                    2.10.0             
idna                    2.10               
importlib-metadata      4.3.1              
joblib                  1.0.1              
Keras                   2.3.0              
Keras-Applications      1.0.8              
keras-nightly           2.5.0.dev2021032900
Keras-Preprocessing     1.1.2              
Markdown                3.3.4              
matplotlib              2.1.2              
mock                    4.0.3              
numpy                   1.18.5             
oauthlib                3.1.0              
opt-einsum              3.3.0              
pandas                  1.2.4              
pip                     20.0.2             
protobuf                3.17.1             
pyasn1                  0.4.8              
pyasn1-modules          0.2.8              
pyparsing               2.4.7              
python-dateutil         2.8.1              
pytz                    2021.1             
PyYAML                  5.4.1              
requests                2.25.1             
requests-oauthlib       1.3.0              
rsa                     4.7.2              
scikit-learn            0.24.2             
scipy                   1.6.3              
setuptools              45.2.0             
six                     1.15.0             
tensorboard             1.15.0             
tensorboard-data-server 0.6.1              
tensorboard-plugin-wit  1.8.0              
tensorflow              1.15.5             
tensorflow-estimator    1.15.1             
termcolor               1.1.0              
threadpoolctl           2.1.0              
typing-extensions       3.7.4.3            
urllib3                 1.26.5             
Werkzeug                2.0.1              
wheel                   0.36.2             
wrapt                   1.12.1             
xgboost                 0.80               
zipp                    3.4.1

但还是出现上面第一段描述的问题,希望能获得您的进一步的帮助,谢谢。

LongyuanCode avatar May 29 '21 06:05 LongyuanCode

简单概括就是Tensorflow 1.15要求:

ERROR: tensorflow 1.15.5 has requirement keras-applications>=1.0.8, but you'll have keras-applications 1.0.2 which is incompatible.
ERROR: tensorflow 1.15.5 has requirement keras-preprocessing>=1.0.5, but you'll have keras-preprocessing 1.0.1 which is incompatible.

但是keras 2.2.0要求:

ERROR: keras 2.2.0 has requirement keras-applications==1.0.2, but you'll have keras-applications 1.0.8 which is incompatible.
ERROR: keras 2.2.0 has requirement keras-preprocessing==1.0.1, but you'll have keras-preprocessing 1.1.2 which is incompatible.
  • 这两个要求是矛盾的。

LongyuanCode avatar May 29 '21 13:05 LongyuanCode