一般是关于内存异常: 详细解释 gdb使用 1.往受到系统保护的内存地址写数据 有些内存是内核占用的或者是其他程序正在使用,为了保证系统正常工作,所以会受到系统的保护,而不能任意访问。可能是因为其他用户正在跑程序,等他们不跑了试一试。
【10】
nvidia-smi的时候没有进程出现
解决办法:服务器没有装gpu版本的torch,只有cpu版本的,所以自然识别不出来cuda
Pip安装1.0.0版本的torch就可以了
python
import torch
torch.cuda.is_available()
【11】
不用sudo的情况下更新pip
/home/chenhao/anaconda3/bin/python -m pip install --upgrade pip
【12】
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
ssh-keygen -R 服务器地址
【13】
pkg_resources.DistributionNotFound: The &#39;wheel; python_version < &#34;3&#34;&#39; distribution was not found and is required by the application
tensorboard版本不对,重新安装最新版的就可以了
【14】
ModuleNotFoundError: No module named &#39;torch&#39;
Pip安装的torch(usr/lib/下面)跟我实际使用的python(conda)是在两个位置,因此pip3安装成功,但是conda却找不到。直接conda install troch会报错
之后去官网https://pytorch.org/找到了官方下载命令
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
【15】
服务器提示某个包报错,装不上,环境不匹配等
解决办法:从另一个正常运行的服务器上面复制一份过来,拷贝到
/home/chenhao/anaconda3/lib/python3.6/site-packages/
/home/chenhao/anaconda3/lib/python3.7/ site-packages/
【16】
&#34;/home/xxx/anaconda3/envs/LIIR/lib/python3.6/site-packages/smac/env/starcraft2/starcraft2.py&#34;, line 292, in _launch
self._run_config = run_configs.get(version=self.game_version)
TypeError: get() got an unexpected keyword argument &#39;version&#39;
解决办法:https://github.com/oxwhirl/pymarl/issues/53
SMAC requires that you use pysc2>=3.0.0. Please update it!
【17】
ModuleNotFoundError:没有名为“ numpy.testing.nosetester”的模块
升级scipy到更高版本。
pip install numpy==1.18
pip install scipy==1.1.0
pip install scikit-learn==0.21.3
【18】
明明在mac上安装了torch包,但是vscode运行代码的时候还是会报错
原因:本地有多个python环境
切换一下环境就好了
【19】
tmux用不了
https://github.com/tmux/tmux/issues/1215
本质原因:由于没有sudo权限导致无法建立文件夹,解决方案就是在自己的目录里面建立文件夹之后用$SHELL来刷新
【20】
mac上面vscode报错PermissionError: [Errno 1] Operation not permitted
原因:系统更新之后需要重新授予vscode完全的磁盘访问权限,并重启vscode。
【21】
Expected object of backend CPU but got backend CUDA for argument #4 &#39;mat1&#39;
解决办法:self.agent.cuda()
【22】
RuntimeError: Only Tensors created explicitly by the user (graph leaves) support the deepcopy protocol at the moment
原因:调用copy.deepcopy的时候出问题
解决办法:参考这个链接
【23】
IndexError: Dimension out of range (expected to be in range of [-2, 1], but got 2)
原因:少了一个维度,输入的是二维的,而人家需要的是三维的
注意区分使用矩阵乘法bmm和mm的时候有没有batch
【24】
No module named _internal.cli.main
别急着下载get-pip.py,先看看自己是不是输入的是pip install xx,之前安的pip3,换成pip3 install xx就好了
【25】
module &#39;torch&#39; has no attribute &#39;square&#39;
解决办法:手动改成两个相同元素做torch.mul
【26】
&#39;float&#39; object has no attribute &#39;item&#39;
epymarl的q_learner的132行:grad_norm后面多加了.item()
明明原版的pymarl里面没加.item()的,epymarl里面加了,还报错
【27】
pycharm里面的file-setting-project-project structure-content root
新增content root等效于:
import sys
sys.path.append(&#39;/home/ChenHao/code/xx&#39;)
可以用于解决Windows环境和Linux环境关于添加运行路径的问题
【28】
pytorch ImportError: libprotobuf.so.9: cannot open shared object file: No such file or directory
动态链接库的问题
export LD_LIBRARY_PATH=/usr/local/lib
或者是在服务器自己的用户目录下新建文件夹,把对应的so文件放进去,如果名字不一样就用 ln -s 原始文件 新文件 来生成软链接,使得系统能读取到改目录下的so文件
【29】
报错:sessions should be nested with care, unset $TMUX to force
解决:unset TMUX
【30】
问题:解决每次打开终端都需要source .bashrc
解决方案:编辑默认目录下面的.bash_profile文件(在mobaxterm里面默认是隐藏文件),在文件结尾添加如下内容即可
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi 【31】
AttributeError: module ‘cv2‘ has no attribute ‘gapi_wip_gst_GStreamerPipeline‘
降低openc-python的版本:
pip install opencv-python==4.1.2.30<hr/>还没解决的问题
欢迎大家提意见!
【1】
AttributeError: module &#39;torch&#39; has no attribute &#39;square&#39;