我正在尝试在 Tesla V100-SXM2 GPU 上运行 CuDNNLSTM 层,但由于安装了 TensorFlow-gpu 2.0.0(无法降级,因为是共享服务器)而出现错误。
ConfigProto 选项在 tf 2.0.0 中已弃用,因此以前的此类线程无济于事。
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "2" # Or 2, 3, etc. other than 0
tf.config.gpu.set_per_process_memory_growth(True)
tf.config.set_soft_device_placement(True)
如果我使用此代码行,则会出现另一个错误:
模块未找到错误:没有名为“tensorflow.contrib”的模块