ModuleNotFoundError No module named tensorflowcompat
This error occurs when the TensorFlow version being used does not have the module "tensorflow.compat" installed. This module is used to provide backward compatibility with older versions of TensorFlow.
To fix this error, you can try upgrading TensorFlow to the latest version using the command:
!pip install --upgrade tensorflow
If upgrading TensorFlow does not work, you can try installing the missing module using the command:
!pip install tensorflow.compat.v1
Then, import the module using:
import tensorflow.compat.v1 as tf
Note that if you are using TensorFlow 2.0 or later, the "compat" module may not be available. In this case, you should update your code to use the new TensorFlow 2.0 API instead
原文地址: https://www.cveoy.top/t/topic/g6nK 著作权归作者所有。请勿转载和采集!