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
不知道怎么解决
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
不知道怎么解决