zhaoyingjun / chatbot

ChatGPT带火了聊天机器人,主流的趋势都调整到了GPT类模式,本项目也与时俱进,会在近期更新GPT类版本。基于本项目和自己的语料可以训练出自己想要的聊天机器人,用于智能客服、在线问答、闲聊等场景。
3.53k stars 1.02k forks source link

ImportError: cannot import name 'dtensor' #176

Open xiaqiancheng opened 4 months ago

xiaqiancheng commented 4 months ago

Traceback (most recent call last): File "data_util.py", line 71, in create_vocab(input_lang,vocab_inp_path,vocab_inp_size) File "data_util.py", line 52, in create_vocab tokenizer = tf.keras.preprocessing.text.Tokenizer(num_words=vocab_size, oov_token=3) File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/tensorflow/python/util/lazy_loader.py", line 62, in getattr module = self._load() File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/tensorflow/python/util/lazy_loader.py", line 45, in _load module = importlib.import_module(self.name) File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 941, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 941, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 941, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/keras/init.py", line 20, in from keras import distribute File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/keras/distribute/init.py", line 18, in from keras.distribute import sidecar_evaluator File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/keras/distribute/sidecar_evaluator.py", line 22, in from keras.optimizers.optimizer_experimental import ( File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/keras/optimizers/init.py", line 26, in from keras.optimizers.legacy import adadelta as adadelta_legacy File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/keras/optimizers/legacy/adadelta.py", line 17, in from keras.optimizers.optimizer_v2 import adadelta File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/keras/optimizers/optimizer_v2/adadelta.py", line 21, in from keras.optimizers.optimizer_v2 import optimizer_v2 File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/keras/optimizers/optimizer_v2/optimizer_v2.py", line 26, in from keras import initializers File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/keras/initializers/init.py", line 22, in from keras.initializers import initializers_v2 File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/keras/initializers/initializers_v2.py", line 23, in from keras.dtensor import utils File "/home/xia/.pyenv/versions/3.6.15/lib/python3.6/site-packages/keras/dtensor/init.py", line 22, in from tensorflow.compat.v2.experimental import dtensor as dtensor_api ImportError: cannot import name 'dtensor' python3.6.15,tensorflow版本也是2.6.0 不知道怎么解决