[英]ModuleNotFoundError: No module named 'tensorflow.contrib' while making chatbot
So I'm following a tutorial and making a chatbot in python and I'm using the tflearn
and tensorflow
modules, and when I run my code I get the following error:所以我按照教程在 python 中制作了一个聊天机器人,我正在使用tflearn
和tensorflow
模块,当我运行我的代码时,我收到以下错误:
Traceback (most recent call last):
File "/home/user/Coding Projects/chatbot/main.py", line 6, in <module>
import tflearn
File "/home/user/.local/lib/python3.8/site-packages/tflearn/__init__.py", line 4, in <module>
from . import config
File "/home/user/.local/lib/python3.8/site-packages/tflearn/config.py", line 5, in <module>
from .variables import variable
File "/home/user/.local/lib/python3.8/site-packages/tflearn/variables.py", line 7, in <module>
from tensorflow.contrib.framework.python.ops import add_arg_scope as contrib_add_arg_scope
ModuleNotFoundError: No module named 'tensorflow.contrib'
I can't figure out how to fix it, and was wondering if someone could help me.我不知道如何解决它,并想知道是否有人可以帮助我。
check your tensorflow version(you can to check it like that) `检查你的 tensorflow 版本(你可以这样检查)`
import tensorflow as tf
print(tf.__version__)
`
tensorflow contrib was removed from tensorflow 2.0 and its functionallty was moved to other modules. tensorflow contrib 已从 tensorflow 2.0 中删除,其功能已移至其他模块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.