Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cnn_2019.ipynb(防止 tensorflow 占用所有显存)tensorflow2.0要怎么改 #71

Open
hechengdu opened this issue Mar 6, 2022 · 1 comment

Comments

@hechengdu
Copy link

import tensorflow as tf
import tensorflow.keras.backend as K

config = tf.ConfigProto()
config.gpu_options.allow_growth=True
sess = tf.Session(config=config)
K.set_session(sess)

这段代码 tensorflow2.0要怎么改

@ypwhs
Copy link
Owner

ypwhs commented Mar 8, 2022

tf.config.gpu.set_per_process_memory_growth(enabled=True)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants