must be regenerated with protoc >= 3.19.0.

  • 卸装高版本,安装低版本
pip uninstall protobuf
pip install -i https://pypi.douban.com/simple protobuf==3.20.0

No module named ‘tensorflow_core.estimator’

查看tensorflow-estimator的版本和tensorflow版本是否一致

conda list|grep tensorflow 
conda install tensorflow-estimator==2.1.0

matplotlib中文乱码处理

python
import matplotlib
matplotlib.get_cachedir() #查看缓存目录&删除缓存目录
rm -rf .cache目录

查所字体文件路径
import matplotlib    
print(matplotlib.matplotlib_fname()) 
复制字体到目录下SimHei.ttf



xlrd.biffh.XLRDError: Excel xlsx file; not supported

xlrd过高,卸载旧版本重新安装1.2.0



TypeError: init() got an unexpected keyword argument ‘ragged’

训练使用的tensorflow版本一致可能导致此错误,重新训练一下



AttributeError: ‘tuple’ object has no attribute ‘layer’

是keras和tf版本冲突了,使用tf.keras,并uninstall keras 即可

pip uninstall keras
pip uninstall tensorflow
pip uninstall keras-transformer

Could not load dynamic library ‘libnvinfer.so.6’

安装tensorrt

sudo apt-get install -y --no-install-recommends libnvinfer6=6.0.1-1+cuda10.1 \
    libnvinfer-dev=6.0.1-1+cuda10.1 \
    libnvinfer-plugin6=6.0.1-1+cuda10.1

Could not load dynamic library ‘libnvinfer.so.6’; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory

安装tensorflow-cpu

pip install tensorflow-cpu==2.1 -i  https://pypi.douban.com/simple
ERROR: pytest-astropy 0.8.0 requires pytest-cov>=2.0, which is not installed.

ERROR: pytest-astropy 0.8.0 requires pytest-filter-subpackage>=0.1, which is not installed.

缺少的库
pip install -i https://pypi.douban.com/simple  pytest-filter-subpackage==0.1
pip install -i https://pypi.douban.com/simple  pytest-cov==2.0