Python 在tensorflow和keras中执行教程时出错

Python 在tensorflow和keras中执行教程时出错,python,tensorflow,keras,Python,Tensorflow,Keras,所以我运行了这个,我得到了一个错误 ModuleNotFoundError:没有名为“tensorflow.python.layers”的模块 这是我的pip列表 import sys import os import argparse from setup.settings import hparams sys.path.append(os.path.realpath(os.path.dirname(__file__))) sys.path.append(os.path.realpath(os

所以我运行了这个,我得到了一个错误 ModuleNotFoundError:没有名为“tensorflow.python.layers”的模块

这是我的pip列表

import sys
import os
import argparse
from setup.settings import hparams
sys.path.append(os.path.realpath(os.path.dirname(__file__)))
sys.path.append(os.path.realpath(os.path.dirname(__file__)) + "/nmt")
from nmt import nmt
import tensorflow.compat.v1 as tf



# Modified autorun from nmt.py (bottom of the file)
# We want to use original argument parser (for validation, etc)
nmt_parser = argparse.ArgumentParser()
nmt.add_arguments(nmt_parser)
# But we have to hack settings from our config in there instead of commandline options
nmt.FLAGS, unparsed = nmt_parser.parse_known_args(['--'+k+'='+str(v) for k,v in hparams.items()])
# And now we can run TF with modified arguments
tf.app.run(main=nmt.main, argv=[os.getcwd() + '\nmt\nmt\nmt.py'] + unparsed)
tb-nightly             2.3.0a20200711                                                                                   
tensorboard            1.14.0                                                                                           
tensorboard-plugin-wit 1.7.0                                                                                            
tensorflow             1.14.0                                                                                           
tensorflow-estimator   1.14.0                                                                                           
termcolor              1.1.0                                                                                            
tf-estimator-nightly   2.4.0.dev2020071101                                                                              
tqdm                   4.47.0