当前位置:网站首页>TensorFlow遇到的各种错误
TensorFlow遇到的各种错误
2022-06-26 09:34:00 【天边一坨浮云】
目录
ImportError: cannot import name 'set_random_seed' from 'tensorflow'
module ‘tensorflow’ has no attribute ‘ConfigProto’/'Session’
`set_session` is not available when using TensorFlow 2.0
OP_REQUIRES failed at save_restore_v2_ops.cc:109 : Not found: Failed to create a NewWriteableFile:
版本问题
很多报错都是因为版本问题,TensorFlow的版本、CUDA的版本等等。比如以下的例子:
ImportError: Could not find 'cudart64_100.dll'
需要下载对应CUDA版本。
或者去网上下载cudart64_100.dll,拷贝到
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\10.1\Development\bin目录下
ImportError: cannot import name 'set_random_seed' from 'tensorflow'
TensorFlow-GPU2.0中遇到这个问题
2.0中的新写法:
import tensorflow
tensorflow.random.set_seed(x)module ‘tensorflow’ has no attribute ‘ConfigProto’/'Session’
tensorflow2.0版本与之前版本有所更新,故将上述代码改成之下即可:
#原版 config = tf.ConfigProto(allow_soft_placement=True)
config = tf.compat.v1.ConfigProto(allow_soft_placement=True)
#原版 sess = tf.Session(config=config)
sess =tf.compat.v1.Session(config=config) #注意 ,这里为tensorflow2.0版本,与第1.0有差距。
`set_session` is not available when using TensorFlow 2.0
若是遇到如题错误,则将
keras.backend.tensorflow_backend.set_session(tf.compat.v1.Session(config=config))
改为
tf.compat.v1.keras.backend.set_session(tf.compat.v1.Session(config=config))
OP_REQUIRES failed at save_restore_v2_ops.cc:109 : Not found: Failed to create a NewWriteableFile:
路径写法问题,错误写法
root_path = "../results/"
正确写法
root_path = "..\\results\\"
边栏推荐
- npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.npm ER
- Leetcode refers to offer II 091 Paint house - modify in place
- What you need to know to test -- URL, weak network, interface, automation
- 【CVPR 2019】Semantic Image Synthesis with Spatially-Adaptive Normalization(SPADE)
- How to correctly open the USB debugging and complete log functions of Huawei mobile phones?
- How to create an IE tab in edge browser
- Do you know the //go: instructions in the go source code, go:linkname?
- 3 big questions! Redis cache exceptions and handling scheme summary
- Redis notes (13) - scan and keys search for specific prefix key fields (command format, usage examples, locating large keys)
- Introduction to QPM
猜你喜欢

PHP extracts TXT text to store the domain name in JSON data

WGCLOUD的web ssh服务端口是多少

Industrial and enterprise patent matching data (hundreds of thousands of data) 1998-2014

Notes on sports planning on November 22, 2021

Mysql database field query case sensitive setting

2021-11-29 quintic polynomial of trajectory planning
QPM suspended window setting information

自动化测试——pytest本身及第三方模块介绍及使用

The 100000 line transaction lock has opened your eyes.

Joint Noise-Tolerant Learning and Meta Camera Shift Adaptation for Unsupervised Person Re-ID
随机推荐
Jupyter Notebook遇到的问题
点击遮罩层关闭弹窗
install opencv-contrib-dev to use aruco code
做测试需要知道的内容——url、弱网、接口、自动化、
Logview Pro can be used if the log is too large
install ompl.sh
Enter the page input box to automatically obtain the focus
2021-11-29 quintic polynomial of trajectory planning
SQL modification of table structure
Comparison of similar PMS in QPM
Common SQL add / delete / modify query statements
How to create an IE tab in edge browser
LeetCode 498. Diagonal traversal
Comprehensive interpretation! Use of generics in golang
LeetCode 498. 对角线遍历
WGCLOUD的web ssh服务端口是多少
节流,防抖,new函数,柯里化
install realsense2: The following packages have unmet dependencies: libgtk-3-dev
Several connection query methods of SQL (internal connection, external connection, full connection and joint query)
Notes on sports planning on November 22, 2021