gpt4 book ai didi

tensorflow - 模块 'tensorflow' 没有属性 'GPUOptions'

转载 作者:行者123 更新时间:2023-12-03 12:44:41 26 4
gpt4 key购买 nike

我正在使用带有 GTX 960M 的戴尔笔记本电脑,并且我安装了 tensorflow 2.0 alpha。我曾经使用 1.5 版本,它与 tf.GPUOptions 一起使用,但在这个版本中,这会导致 error: AttributeError: module 'tensorflow' has no attribute 'GPUOptions'如果我在这个版本上做错了,有人帮助我

Traceback (most recent call last): File "prepare_training.py", line 20, in gpu_option = tf.GPUOptions(per_process_gpu_memory_fraction=0.333) AttributeError: module 'tensorflow' has no attribute 'GPUOptions'

最佳答案

Tensorflow 2.x 与 1.x 相比发生了重大变化。
根据官方消息,

tf.contrib will be removed from the core TensorFlow repository and build process. TensorFlow’s contrib module has grown beyond what can be maintained and supported in a single repository. Larger projects are better maintained separately, while smaller extensions will graduate to the core TensorFlow code. A special interest group (SIG) has been formed to maintain and further develop some of the more important contrib projects going forward. Please engage with this RFC if you are interested in contributing.


如果你想使用 tensorflow 1.x功能/方法,有一个兼容性模块保存在 tensorflow 2.x .
tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=0.333)

关于tensorflow - 模块 'tensorflow' 没有属性 'GPUOptions',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55917154/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com