发布时间:2024-10-25 18:01
两者同时存在时使用gpu
要想使用cpu,在代码里添加如下命令:
matrix1=tf.constant([[3.,3.]])
matrix2=tf.constant([[2.],[2.]])
with tf.Session() as ses:
with tf.device(\"/cpu:0\"):
product=tf.matmul(matrix1,matrix2)
说明一下:
“/cpu:0” The CPU of your machine
“/gpu:0” The GPU of yout machine ,if you have one
如果要换成gpu的话,照着改可以了
或
os.environ[“CUDA_VISIBLE_DEVICES”] = \"-1\"
一行即可
RSA算法解密 javax.crypto.BadPaddingException: Decryption error 异常
JavaScript中如何让 x == 1 && x == 2 && x == 3 等式成立
SpringBoot 实现 Excel 导入导出性能爆表用起来够优雅
使用 CLI 开发 Cloudflare Workers 服务
Hive-异常处理Hive Schema version 2.3.0 does not match metastore's schema version 1.2.0 Metastore is not