- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近使用过
os.environ["CUDA_VISIBLE_DEVICES"]="-1"
禁用我的 GPU 在 tensorflow 中的使用。但是,当我在终端中使用 unset CUDA_VISIBLE_DEVICES 重新启用它时。下次我运行时出现此错误
tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation Conv_1_bn_1/gamma/Initializer/ones: Could not satisfy explicit device specification '' because the node {{colocation_node Conv_1_bn_1/gamma/Initializer/ones}} was colocated with a group of nodes that required incompatible device '/job:localhost/replica:0/task:0/device:GPU:0'. All available devices [/job:localhost/replica:0/task:0/device:CPU:0, /job:localhost/replica:0/task:0/device:XLA_CPU:0].
和
Root Member(assigned_device_name_index_=-1 requested_device_name_='/job:localhost/replica:0/task:0/device:GPU:0' assigned_device_name_='/job:localhost/replica:0/task:0/device:CPU:0' resource_device_name_='/device:GPU:0' supported_device_types_=[CPU, XLA_CPU] possible_devices_=[]
我知道我的 GPU 可以从
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
返回
.......
incarnation: 351568001108855942
physical_device_desc: "device: XLA_CPU device"
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 5729157120
locality {
bus_id: 1
links {
}
}
我还尝试卸载并重新安装tensorflow和tensorflowgpu。我将非常感谢任何和所有的帮助 - 谢谢。
最佳答案
为了解决这个问题,我现在将这行代码放在顶部
sess = tf.Session(config=tf.ConfigProto(device_count={'GPU': 1}))
从现在开始我只会使用禁用 GPU
{'GPU': 0}
我强烈建议使用它作为 os.environ 的替代品
关于python - Tensorflow GPU 未使用,但明显可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59347961/
通常当我请求线程转储时,系统性能不佳的症状很容易解释;也就是说,通常我会看到许多线程显然正在等待一个已被获取但未被另一个释放的监视器。 在这种情况下,我有很多线程在等待监视器 (0x965ad100)
C:\Users\shagy\Desktop\3RD YEAR 2ND SEMESTER\SPM\Newfolder\SPM-SMS>npm start npm ERR! path C:\Users\
我是一名优秀的程序员,十分优秀!