Skip to content
New issue

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

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

Already on GitHub? Sign in 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)

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

No branches or pull requests

2 participants