tensorflow2.x has been greatly changed over 1.x to make TensorFlow users more efficient. Where Tf.contrib was abandoned altogether is a major change of 2.x version, but import tensorflow.contrib.slim as Slim as a superior package, has been widely used in many previous versions. Most of the source code is still written based on the TensorFlow1.x version, which makes some modules that have been removed from the 2.x version unusable.
when running a
import tensorflow. Contrib. Slim as slim code>
: ModuleNotFoundError: No module named 'tensorflow. Contrib KBD> false
query existing solutions, most of the use of the reduced version of the method, if you want to use this method can go to the query.
because I don't want to use the method of reducing the version to solve, after searching on github to find out the information
link: tf.contrib.slim is not worked in tensorflow 2.0 what is the alternative for that?.
Tf - slim has a independent of tensorflow mirror to tf.com pat. V1 compatible mode is used, install the package can be p>
tf-slim is a lightweight library for defining, training, and evaluating complex models in TensorFlow. Tf-slim's components can be freely blended with the native TensorFlow and other frameworks.
here you can find information about Slim: link.
use PIP to download tf-slim
pip install --upgrade tf_slim
note when using Slim library:
#import tensorflow.contrib.slim as slim import tf_slim as slim
where the commented out part is the source code, modified no longer report an error.
(ps: the ability is limited, if there is an error, please point out.
- Problem solving module ‘ tensorflow.compat . V2 ‘has no attribute’ contrib ‘and importerror cannot import name’ auto ‘
- Attributeerror: module tensorflow no attribute app solution
- Windows10解决ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed
- Tensorflow installation and uninstall (Anaconda version)
- tf.contrib.layers .xavier_ Initializer function usage
- Error: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version
- Tensorflow error: module ‘tensorflow’ has no attribute ‘xxx’
- Cmake compile opencv report error qtcore_ DIR QtOpenglDIR QtGui_ Dir ffmpeg loading failed
- numpy.core.umath How to solve the problem of failed to import
- Using pip to install tensorflow: tensorflow — is not a supported wheel on this platform
- Several solutions to HDF5 error reporting in Python environment
- Error configuration process, project files may be invalid
- “Error in configuration process project files may be invalid” appears during cmake compilation
- Solve the MAC terminal download error curl: (7) failed to connect to raw.githubusercontent.com port 443: Connection refused
- “Fatal error: Unable to find local grunt.” when running “grunt” command
- R language loading xlsx error error: JAVA_HOME cannot be determined from the Registry
- After tensorflow installation, an error occurred while importing: importerror: DLL load failed: the specified module could not be found
- The most practical [rar password cracking method]
- ImportError: DLL load failed: The specified module could not be found
- Exception ignored in: bound method basesession__ del__ Of