Merge pull request #176 from PhanatosZou/master

Compatible with TF2.0
This commit is contained in:
nl8590687 2020-03-28 21:33:40 +08:00 committed by GitHub
commit 4e4aad07ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -17,10 +17,12 @@ from SpeechModel251 import ModelSpeech
os.environ["CUDA_VISIBLE_DEVICES"] = "0" os.environ["CUDA_VISIBLE_DEVICES"] = "0"
#进行配置使用90%的GPU #进行配置使用90%的GPU
config = tf.ConfigProto() config = tf.compat.v1.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.9 config.gpu_options.per_process_gpu_memory_fraction = 0.9
#config.gpu_options.allow_growth=True #不全部占满显存, 按需分配 #config.gpu_options.allow_growth=True #不全部占满显存, 按需分配
set_session(tf.Session(config=config)) sess = tf.compat.v1.Session(config=config)
tf.compat.v1.keras.backend.set_session(sess)
datapath = '' datapath = ''

View File

@ -16,10 +16,11 @@ from SpeechModel251 import ModelSpeech
os.environ["CUDA_VISIBLE_DEVICES"] = "0" os.environ["CUDA_VISIBLE_DEVICES"] = "0"
#进行配置使用95%的GPU #进行配置使用95%的GPU
config = tf.ConfigProto() config = tf.compat.v1.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.95 config.gpu_options.per_process_gpu_memory_fraction = 0.95
#config.gpu_options.allow_growth=True #不全部占满显存, 按需分配 #config.gpu_options.allow_growth=True #不全部占满显存, 按需分配
set_session(tf.Session(config=config)) sess = tf.compat.v1.Session(config=config)
tf.compat.v1.keras.backend.set_session(sess)
datapath = '' datapath = ''