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

设置显存使用策略 #37

Open
moriwang opened this issue Nov 15, 2019 · 0 comments
Open

设置显存使用策略 #37

moriwang opened this issue Nov 15, 2019 · 0 comments

Comments

@moriwang
Copy link

设置显存按需使用的 code 报错。

gpus = tf.config.experimental.list_physical_devices(device_type='GPU')
for gpu in gpus:
    tf.config.experimental.set_memory_growth(device=gpu, True)

显示 SyntaxError: positional arguments follows keyword argument

第三行需要修改一下才能运行

tf.config.experimental.set_memory_growth(gpu, True)
或
tf.config.experimental.set_memory_growth(device=gpu, enable=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

1 participant