How did “people you might know” find you on social software>>>
Copyright notice: This article is the original article of the blogger, following the CC 4.0 by-sa copyright agreement. Please attach the link of the original source and this notice for reprint.
Link to this article:
https://blog.csdn.net/qq_ 33440324/article/details/94200046
Operation:
import tensorflow as tf
sess=tf.Session(config=tf.ConfigProto(log_device_placement=True))
1
2
appears:
AttributeError: module 'tensorflow' has no attribute 'Session'
Reason:
because it is tensorflow version 2.0
How to solve this problem:
it is necessary to use
tf.compat.v1.Session()
Substitution
tf.Session()`
The above code must be:
import tensorflow as tf
sess=tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(log_device_placement=True))
Two versions tensor flows relative to: https://docs.google.com/spreadsheets/d/1FLFJLzg7WNP6JHODX5q8BDgptKafq_slHpnHVbJIteQ/edit#gid=0
Similar Posts:
- [Solved] Failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
- Tensorflow reported an error when using session module: attributeerror: module ‘tensorflow’ has no attribute ‘session’, which has been solved
- [Solved] TensorFlow Error: InternalError: Failed copying input tensor
- “Failed to get convolution algorithm. This is probably because cuDNN failed to initialize”
- Error in calling GPU by keras or tensorflow: blas GEMM launch failed
- Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
- [Solved] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
- Completely solve MySQL error: 1030, ‘got error 28 from storage engine’
- cleartext http traffic to 192.168.1.106 not permitted
- The solution of CUDA error: out of memory in yolo3 training