1.pycharm中无法使用conda activate 命令激活conda环境的解决办法
1.打开pycharm,File -> Settings -> Tools -> Terminal
2,在Shell path(shell路径)那里,
用:cmd.exe "/K" D:\Anaconda\Scripts\activate.bat your_environment_name 替换原来的路径
其中”your_environment_name“要替换成你已经创建的conda虚拟环境。” D:\Anaconda\Scripts\activate.bat“替换成你的conda安装路径中Scripts\activate.bat文件的位置。
3,配置好之后点击应用,重启pycharm终端就正常了!
2,报错:TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are: 1. Downgrade the protobuf package to 3.20.x or lower. 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
类型错误:无法直接创建描述符。
如果此调用来自_pb2.py文件,则生成的代码已过期,必须使用protoc>=3.1.0重新生成。
解决办法:
pip install protobuf==3.19.0
3,
调取tensorboard报错:TypeError: MessageToJson() got an unexpected keyword argument including
训练时调取tensorboard报错:TypeError: MessageToJson() got an unexpected keyword argument including。并且没有显示图像。
这是由于tensorboard版本过高导致,只需要将tensorboard版本降低即可。降低至2.1.0便可以正常使用。
激活虚拟环境 conda activate 虚拟环境
降低tensorboard版本为2.1.0
pip install tensorboard==2.1.0
4,
问题描述
raise AttributeError("module {!r} has no attribute "
AttributeError: module ‘numpy’ has no attribute ‘int’
原因分析:
numpy版本太高,下一个低版本即可
解决方案:
pip install numpy==1.21 -i https://pypi.tuna.tsinghua.edu.cn/simple