【发布时间】:2021-02-25 13:03:12
【问题描述】:
我有一台装有 Windows 10 Pro 和 Python 3.6 的笔记本电脑。
这是我在 Windows 上的pip freeze:
numpy==1.19.5
absl-py==0.10.0
aiofiles==0.6.0
aiohttp==3.7.3
APScheduler==3.6.3
astor==0.8.1
async-generator==1.10
async-timeout==3.0.1
attrs==20.3.0
bidict==0.21.2
blis==0.7.4
boto3==1.16.50
botocore==1.19.50
bz2file==0.98
cached-property==1.5.2
cachetools==4.2.0
catalogue==1.0.0
certifi==2020.12.5
cffi==1.14.4
chardet==3.0.4
click==7.1.2
cloudpickle==1.6.0
colorama==0.4.4
colorclass==2.2.0
coloredlogs==10.0
colorhash==1.0.3
ConfigArgParse==1.2.3
contextvars==2.4
cryptography==3.3.1
cycler==0.10.0
cymem==2.0.5
dataclasses==0.8
decorator==4.4.2
dill==0.3.3
dnspython==1.16.0
docopt==0.6.2
dopamine-rl==3.0.1
fbmessenger==6.0.0
Flask==1.1.2
future==0.18.2
gast==0.2.2
gevent==1.5.0
gin-config==0.4.0
google-api-core==1.24.1
google-api-python-client==1.12.8
google-auth==1.24.0
google-auth-httplib2==0.0.4
google-pasta==0.2.0
googleapis-common-protos==1.52.0
greenlet==0.4.17
grpcio==1.34.0
gunicorn==20.0.4
gym==0.18.0
h11==0.8.1
h2==3.2.0
h5py==3.1.0
hpack==3.0.0
hstspreload==2020.12.22
httpcore==0.3.0
httplib2==0.18.1
httptools==0.1.1
httpx==0.9.3
humanfriendly==9.1
hyperframe==5.2.0
idna==2.10
idna-ssl==1.1.0
immutables==0.14
importlib-metadata==3.3.0
importlib-resources==4.1.1
itsdangerous==1.1.0
Jinja2==2.11.2
jmespath==0.10.0
jsonpickle==1.4.2
jsonschema==3.2.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kfac==0.2.0
kiwisolver==1.3.1
Markdown==3.3.3
MarkupSafe==1.1.1
matplotlib==3.3.3
mattermostwrapper==2.2
mesh-tensorflow==0.1.18
mpmath==1.1.0
multidict==4.6.1
murmurhash==1.0.5
networkx==2.3
oauth2client==4.1.3
opencv-python==4.5.1.48
opt-einsum==3.3.0
packaging==19.2
pika==1.0.1
Pillow==7.2.0
plac==1.1.3
preshed==3.0.5
promise==2.3
prompt-toolkit==3.0.9
protobuf==3.14.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
pydot==1.4.1
pyglet==1.5.0
PyJWT==1.7.1
pykwalify==1.7.0
pymongo==3.11.2
pyparsing==2.4.7
pypng==0.0.20
pyreadline==2.1
pyrsistent==0.17.3
python-crfsuite==0.9.7
python-dateutil==2.8.1
python-engineio==4.0.0
python-socketio==5.0.4
python-telegram-bot==11.1.0
pytz==2019.3
PyYAML==5.3.1
questionary==1.9.0
rasa==1.6.0
rasa-sdk==1.6.1
redis==3.3.11
requests==2.25.1
requests-async==0.5.0
requests-toolbelt==0.9.1
rfc3986==1.4.0
rocketchat-API==0.6.36
rsa==4.6
ruamel.yaml==0.15.100
s3transfer==0.3.3
sanic==19.9.0
Sanic-Cors==0.9.9.post1
sanic-jwt==1.5.0
Sanic-Plugins-Framework==0.9.4.post1
scikit-learn==0.20.4
scipy==1.5.4
six==1.15.0
sklearn-crfsuite==0.3.6
slackclient==1.3.2
sniffio==1.2.0
spacy==2.3.5
SQLAlchemy==1.3.22
srsly==1.0.5
sympy==1.7.1
tabulate==0.8.7
tensor2tensor==1.14.1
tensorboard==1.15.0
tensorflow==1.15.3
tensorflow-datasets==3.1.0
tensorflow-estimator==1.15.1
tensorflow-gan==2.0.0
tensorflow-hub==0.11.0
tensorflow-metadata==0.26.0
tensorflow-probability==0.7.0
termcolor==1.1.0
terminaltables==3.1.0
thinc==7.4.5
tqdm==4.55.1
twilio==6.50.1
typing-extensions==3.7.4.3
tzlocal==2.1
uritemplate==3.0.1
urllib3==1.26.2
wasabi==0.8.0
wcwidth==0.2.5
webexteamssdk==1.6
websocket-client==0.54.0
websockets==8.1
Werkzeug==1.0.1
wrapt==1.12.1
yarl==1.6.3
zipp==3.4.0
我正在处理的项目使用 Rasa 1.6.0,并且满足这些要求,一切都在 Windows 上按预期运行。
但是,对于特定任务,我需要在 Ubuntu 上,因此我在 VirtualBox 6.1 机器上安装了 Ubuntu 18.04,安装了 python 和 pip 并运行 pip install -r requirements.txt 命令来安装完全相同的要求机器,在虚拟环境中。
在此之后,如果我尝试在 shell 上运行 rasa train 或在 python 控制台上运行 import tensorflow as tf,则会出现错误:
Illegal instruction (core dumped)
关于此错误的原因可能是什么的任何想法?
我看到有人说tensorflow 可能与所使用的处理器架构不兼容,但在我的情况下,这不应该是问题,因为一切都在 Windows 上运行(对吗?)。
我也尝试卸载 tensorflow 并按照一些在线教程到 Build from source 但现在,当我运行 rasa --version 时,不再找到 tensorflow:
$ rasa --version
Traceback (most recent call last):
File "/home/<USER>/Desktop/venv_rasa/bin/rasa", line 8, in <module>
sys.exit(main())
File "/home/<USER>/Desktop/venv_rasa/lib/python3.6/site-packages/rasa/__main__.py", line 69, in main
set_log_level(log_level)
File "/home/<USER>/Desktop/venv_rasa/lib/python3.6/site-packages/rasa/utils/common.py", line 68, in set_log_level
update_tensorflow_log_level()
File "/home/<USER>/Desktop/venv_rasa/lib/python3.6/site-packages/rasa/utils/common.py", line 108, in update_tensorflow_log_level
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
但是,在 Python 控制台中,我可以导入 tensorflow,但如果我尝试访问任何内容,则会显示其他错误:
>>> import tensorflow as tf
>>> tf.__version__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute '__version__'
>>>
>>> mnist = tf.keras.datasets.mnist
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'keras'
我错过了什么吗? 我是不是做错了什么?
提前致谢!
【问题讨论】:
-
您介意在您的描述中更新您的 rasa 版本吗?我很确定它不是 3.6,因为那个版本还不存在 =)
-
@Melinda 你是对的!它的 1.6.0 而不是 3.6。已经改正了。谢谢!
标签: python-3.x tensorflow virtualbox ubuntu-18.04 rasa