NarcissusInMirror / DailyWorkLog

0 stars 0 forks source link

2019年5月-8月 #6

Closed NarcissusInMirror closed 4 years ago

NarcissusInMirror commented 5 years ago

2019.5.3工作日志

Batch Normalization introduction

NarcissusInMirror commented 5 years ago

2019.5.4~2019.5.6工作日志

NarcissusInMirror commented 5 years ago

2019.5.12工作日志

使用LaTex和Word进行毕业论文排版中遇到的问题

Mac字体的问题

image https://github.com/sqyx008/BUPTBachelorThesis/issues/17#issuecomment-392757819

Word的中行距调整

LaTex中表格过宽问题:

NarcissusInMirror commented 5 years ago

2019.5.13工作日志

CUDA、cuDNN的区别

查看CUDA和cuDNN版本

文件大小问题

视频文件格式、视频封装格式、视频编码方式的区别

FOURCC常用编码器

CV_FOURCC('P','I','M','1') = MPEG-1 codec CV_FOURCC('M','J','P','G') = motion-jpeg codec CV_FOURCC('M', 'P', '4', '2') = MPEG-4.2 codec CV_FOURCC('D', 'I', 'V', '3') = MPEG-4.3 codec CV_FOURCC('D', 'I', 'V', 'X') = MPEG-4 codec CV_FOURCC('U', '2', '6', '3') = H263 codec CV_FOURCC('I', '2', '6', '3') = H263I codec CV_FOURCC('F', 'L', 'V', '1') = FLV1 codec

*opencv的videowriter只能输出.avi,如果在指定输出文件名时出现后缀.mp4等则会报错,改为.avi即可**

NarcissusInMirror commented 5 years ago

2019.5.15工作日志

预测与决策

神经网络和概率

NarcissusInMirror commented 5 years ago

2019.5.16工作日志

python写入excel

NarcissusInMirror commented 5 years ago

2019.5.17工作日志

各类卷积核

NarcissusInMirror commented 5 years ago

2019.5.21工作日志

毕设相关工作,查重报告、评分表签字

opencv中修改图片大小

h,w,depth=img.shape
img=cv2.resize(img,(int(w/2),int(h/2)),interpolation=cv2.INTER_AREA) # 交换height和width的顺序

其中,interpolation参数代表所使用的插值方法,其选项如图所示 image

视频编解码

NarcissusInMirror commented 5 years ago

2019.5.22工作日志

NarcissusInMirror commented 5 years ago

2019.5.24工作日志

不小心执行了rm -f,除了跑路,如何恢复?

Screenshot 2019-05-24 at 10 18 23
NarcissusInMirror commented 5 years ago

2019.5.25工作日志

CPU相关

查看服务器CPU的个数、CPU的核数、多核超线程数 CPU个数,核心数,线程数 CPU个数、CPU核心数、CPU线程数 Understanding %CPU while running top command About processors, chips, sockets, and cores

NarcissusInMirror commented 5 years ago

2019.5.27工作日志

NarcissusInMirror commented 5 years ago

2019.5.29工作日志

NarcissusInMirror commented 5 years ago

2019.5.30工作日志

#include <iostream>
#include <fstream>     //读写文件要包含的头部
using namespace std;

int main()
{
    unsigned char a[8] = {0, 255, 52, 53, 54, 55, 56, 57};  //写文件的buffer
    unsigned char b[8]; //读文件的buffer

    // 写文件
    ofstream ouF;
    ouF.open("./me.dat", std::ofstream::binary); //第二个参数是读写二进制文件的关键
    ouF.write(reinterpret_cast<const char*>(a), sizeof(int) * 2); 
    // 第一个参数是将指针强制转换成char型的,我的理解是读取二进制数据时需要每次读一个字节,
    // 指针自加时每次增加一个字节。
    // 第二个参数是读出的字节数,填数字即可,这里sizeof(int)*2和8是等价的,即读出八个字节
    ouF.close();

    // 读出文件
    ifstream inF;
    inF.open("./me.dat", std::ifstream::binary);
    int counter = 0;

    char * c = reinterpret_cast<char*>(b); // 将指针转换为char型

    // 下方的条件用以判断是否读到文件末尾。使用!inF.eof()会导致多读一个字节,原因不明。
    while(inF.peek() != EOF)  
    {
        inF.read(c, sizeof(unsigned char) * 1); //每次读出一个字节到数组b中
        cout<<counter<<endl; 
        cout<<c<<endl; //打印出指针所指地址的值,即当前读出的字节
        counter ++; 
        c ++ ; //指针自加
    }

    inF.close();
    return 0;

}

Python中调用C++代码

NarcissusInMirror commented 5 years ago

2019.6.3工作日志

阅读论文 CBAM: Convolutional Block Attention Module

NarcissusInMirror commented 5 years ago

2019.6.6工作日志

pytorch中torch.nn和torch.nn.functional的区别

NarcissusInMirror commented 5 years ago

2019.6.10工作日志

python中all的作用

NarcissusInMirror commented 5 years ago

2019.6.13工作日志

word中目录的操作

NarcissusInMirror commented 5 years ago

2019.6.29工作日志

Python中的 // 操作符

Python3中/直接是浮点运算,//代表整型运算,即对结果进行flooring操作。而在Python2/中默认是整型运算,除非其中的一个操作数为浮点数

屏幕快照 2019-06-20 14 17 00

NarcissusInMirror commented 5 years ago

2019.6.21工作日志

Pytorch 实战总结

输入数据维度:(sample_size, 25) 标签:(sample_size)

CrossEntropyLoss

image 可以看到,要求的输入维度形状,即output = model.forward(input_data)output的形状为(批大小,分类个数 ),维度为2;输入的标签维度应为(批大小,),维度为1,且以0~N-1代表N个类别,不接受二维的one-hot编码,这些需要在进行数据处理时注意。

BatchNorm1d

image image

1d的batchnorm输入的向量是2维或者3维的,即(批大小,特征维数)(批大小,通道数,特征维数)。当输入为2维时features参数为特征维数;当输入为3维时,features参数为通道数。但实际上都是沿着channel的维度进行的batchnorm。

BatchNorm2d

image image

顺带学习一下2d的batchnorm。batchnorm2d的输入必须是4维的,(批大小,通道数,图像高度,图像宽度),num_features为通道数。

batch1d又称为temporal batchnorm, batch2d又称为spatial batchnormal

image image

numpy axis选择

以np.mean(nparray, axis)为例

>>> a = np.array([[1, 2, 3],[4, 5, 6],[7, 8, 9], [10, 11, 12])
>>> a
array([[ 1,  2,  3],
       [ 4,  5,  6],
       [ 7,  8,  9],
       [10, 11, 12]])
>>> a.shape
(4, 3)
>>> np.mean(a, axis=0)
array([5.5, 6.5, 7.5])
>>> np.mean(a, axis=1)
array([ 2.,  5.,  8., 11.])

以axis=0为例,a.shape=[4, 3]四行三列,当选择axis=0时,即选中4,求平均时则求的是4个元素的平均,即按列平均。同理,axis=1时,选中3,求平均时则求的是三个元素的平均,即按行平均。

torch.max 返回值和索引

torch.max(input, dim, keepdim=False, out=None) -> (Tensor, LongTensor)

>>> a = torch.randn(3,3)
>>> a
-0.7845 -1.7758 -1.5602
 1.9941 -1.2037 -0.2332
 0.1480 -0.0921  0.4939
[torch.FloatTensor of size 3x3]

>>> torch.max(a)
1.9940658807754517

>>> torch.max(a,0)
(
 1.9941
-0.0921
 0.4939
[torch.FloatTensor of size 3]
,
 1
 2
 2
[torch.LongTensor of size 3]
)

pytorch Variable的detach和detach_

先占个坑,本次实验中,需要把forward后的向量转成numpy数组进行一些操作,而输入的tensor经过了如下操作,大概是改为gpu向量,具体还需了解,回头补上。

data, label = data.cuda(), label.cuda()
data, label = Variable(data), Variable(label)
optimizer.zero_grad()
output = model.forward(data)

因此进行操作前需要先detach出来并且放到cpu中output = output.detach().cpu()

scipy的softmax

image

from scipy.special import softmax
output = softmax(output, axis=1)

存储和加载模型

image

存储:

  torch.save(model, PATH),model为定义过的nn.Module的子类模块

加载:

  model = torch.load(PATH)
  model.eval()

Adaptive AvgPool2d

image

NarcissusInMirror commented 5 years ago

2019.6.25工作日志

Linux的Tee命令

Lniux tee 命令 image 遇到如下场景: 在调试神经网络代码过程中,需要打印出网络中各处的向量形状,但是由于每个epoch都会重复打印,会占据屏幕大量位置,使得训练结果被隐藏。使用如下命令,将形状信息写入result.txt中,同时将含有关键字epoch的行打印在屏幕上。

python test.py | tee result.txt | grep epoch

pytorch——resnet

image

Resnet源码里有两个类,分别是BasicBlockBottleneck类,其中BasicBlock对应着图中Resnet-18和Resnet-34中的含有两个卷积层的模块;Bottleneck类对应着图中Resnet-50、Resnet-101和Resnet152中的含有三个卷积层的模块。

NarcissusInMirror commented 5 years ago

2019.6.26工作日志

Affine Transformation 仿射变换

image 简单的说,仿射变换就是: image

NarcissusInMirror commented 5 years ago

2019.6.27工作日志

用Python将list中的string转换为int

NarcissusInMirror commented 5 years ago

2019.6.28工作日志

对于最小二乘法的思考

NarcissusInMirror commented 5 years ago

2019.7.1工作日志

Python 列表元素替换

在准备数据中遇到的相关问题

任务描述如下:共有50个包含不同图片数量的文件夹,目标是大致将文件夹均分为5份,并且移动到五个文件夹内。拆分后任务可分为

  1. 获得每个文件夹的大小和文件夹内文件的数目
  2. 将文件夹按大小分组(尽量均分)
  3. 将分组后的文件夹移动至相应五个文件夹下

任务1 使用os模块中的相应函数即可

num_list = os.listdir(PATH)
file_num = len(num_list)

任务2 使用如下算法进行均分 Python List sort()方法

num_list = [...] # 所有文件夹内包含的数目,共50个元素
num_list.sort(reverse=True)

gourps = 5 # 分为5组

load_balance_groups = [[] for grp in range(groups)] # 构建一个有五个空列表元素的列表

for v in num_list:
    load_balance_groups.sort(key=lambda x: sum(x)) # 分别计算五个列表内元素的和并进行排序
    load_balance_groups[0].append(v) # 向最小的列表中加入目前最大的元素

for per in load_balance_groups:
    print(sum(per))

任务3 要实现通过代码进行文件夹的移动,则需要使用字典进行对数值和文件夹名的映射,并且要解决一对多的问题,即若干个文件有相同的大小,一个键(文件数目)对应了多个值(文件夹)。这里使用如下方法进行了解决,参考:Python 字典的一键多值,即一个键对应多个值Python 字典(Dictionary) setdefault()方法

# 首先获得文件数目-文件夹名称的字典
for file in file_list:
    num = len(img_list)
    file_dict = {}
    # 字典的setdefault()方法dict.setdefault(key, default=None),给定key,返回该键对应的值,如果该键不存在则返回default设置的值,并添加键值对key-default,在这里即通过这一方法进行键值对的添加,并且应对了一对多的问题
    file_dict.setdefault(num, []).append(file) 

# 接下来将load_balance_groups中五个列表里的数目替换成对应的文件夹名称
for index, i in enumerate(load_balance_groups):
    for x in i:
        file_name = file_dict[x][0]  # 字典里的每一个值都是列表,取列表中的第一个值
        del file_dict[x][0] # 删除掉已经被检索到的文件夹名,防止出现重复
        print(file_name)
        rep_groups[index].append(file_name)

关于局部变量的理解&栈&栈帧

image image

NarcissusInMirror commented 5 years ago

2019.7.5工作日志

十大高明的Google搜索技巧

NarcissusInMirror commented 5 years ago

2019.7.9工作日志

恢复在VNC中删除的文件

VNC中删除的文件都没有被真正删除,而是被放在了目录~/.local/share/Trash/files 进入目录后通过正则表达式匹配需要恢复的文件,例如今天误删了开头为C0102153的若干张图片,使用命令mv C0102153* /home/qiushuhao/recover即可将当前目录下所有开头为C0102153的文件移动到/home/qiushuhao/recover目录下。

NarcissusInMirror commented 5 years ago

2019.7.18工作日志

关于图片坐标表示

在Linux中重命名

使用mv a.jpg b.jpga.jpg改名为b.jpg 使用mv a.jpg ./images/b如果images目录下存在b目录,则命令表示将a.jpg移动到b目录下,如果不存在b目录,或b为一个文件,则将a移动到images且改名为b,替换掉原来的b文件。

easydict

image

pathlib

This module offers classes representing filesystem paths with semantics appropriate for different operating systems. 可以通过/运算符进行路径的拼接

>>> from pathlib import Path
>>> father_path = Path('data')
>>> sub_path = 'image'
>>> father_path / sub_path
PosixPath('data/image')
>>> father_path
PosixPath('data')

module.eval()

    def eval(self):
        """Sets the module in evaluation mode.

        This has any effect only on modules such as Dropout or BatchNorm.
        """
        return self.train(False)
NarcissusInMirror commented 5 years ago

2019.7.19工作日志

如何在服务器上自己起一个jupyter的端口(没有root权限)

输入命令:$ jupyter notebook --no-browser --port=9999 --ip='*' [--allow-root] 会返回一个地址http://localhost:10000/?token=255f60f4ab56f391b40fdda50ac1970736e091d86fd7f97ahttp://localhost改为服务器的ip即可,例如10.106.128.96:10000/?token=255f60f4ab56f391b40fdda50ac1970736e091d86fd7f97a

即不想保存jupyter日志,又需要看一下token,可以使用tee命令: nohup jupyter notebook --no-browser --port=9999 --ip='*' | tee /dev/null &

如何在jupyter notebook中添加kernel

参考1 参考2 参考3 运行find . -name “kernel.json”会得到以下结果

/home/lixie/.local/share/jupyter/kernels/python3/kernel.json
/home/lixie/anaconda3/envs/py35_1/share/jupyter/kernels/python3/kernel.json
/home/lixie/anaconda3/pkgs/ipykernel-5.1.1-py37h39e3cac_0/share/jupyter/kernels/python3/kernel.json
/home/lixie/anaconda3/pkgs/ipykernel-5.1.1-py37h39e3cac_0/share/jupyter/kernels/py35/kernel.json
/home/lixie/anaconda3/share/jupyter/kernels/python3/kernel.json
/home/lixie/anaconda3/share/jupyter/kernels/py35/kernel.json

其中最后两行是关键部分,在/home/lixie/anaconda3/share/jupyter/kernels/中创建虚拟环境对应的文件夹,在其中创建kernel.json文件,文件内容为,

{
 "argv": [
  "/home/lixie/anaconda3/envs/py35/bin/python",       #python路径
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "py35",   # 在notebook显示的名字
 "language": "python"
}

编辑完成后打开jupyter notebook可以看到新增的kernel,但是无法连接,因为虚拟环境下没有安装ipython kernel,运行命令


$ conda activate lcyVenv          
$ pip install ipykernel  
$ ipython kernel install --user 

如果是系统自带的python,运行上面最后一条命令会报错,应选择下述命令

$ python2 -m pip install ipykernel
$ python2 -m ipykernel install --use

即可。 注意:

centos 7 firewall(防火墙)开放端口/删除端口/查看端口

centos需要打开防火墙,打开特定端口,否则通过上述网址无法访问。(本机可以访问本机的端口,其他机器是不能随意访问端口的,也就是说,如果是在服务器上打开浏览器是可以访问上述地址的,但是远程登录访问主机,如果没有提前将端口开放,是无法访问的)

firewall-cmd --zone=public --add-port=9999/tcp --permanent
firewall-cmd --reload

jupyter notebook没有python3的kernel

运行以下两条命令即可: image

NarcissusInMirror commented 5 years ago

2019.7.22工作日志

跑YOLO网络生成标注视频的时候出现了报错: cannot connect to X server,这是源于代码中有以下两行:

cv2.imshow('Demo', image)
cv2.waitKey(3)

由于服务器没有可视化界面,会出现这样的问题,注释掉即可

YOLO训练记录

darknet_video.py中修改源文件即可跑通

Insight face

NarcissusInMirror commented 5 years ago

2019.7.24工作日志

config = tf.ConfigProto()
config.gpu_options.allow_growth=True # 按需占用GPU,否则会一下把gpu的显存占满 config.gpu_options.per_process_gpu_memory_fraction = 0.5 # 设置占用比例,但如有需要仍会超过此比例 set_session(tf.Session(config=config)) # 加上这一句话才会生效

NarcissusInMirror commented 5 years ago

2019.7.25工作日志

opencv没有视频 PIL画矩形框(left, top, right, buttom) image PIL添加文字 .textsize方法会返回一个元组(x轴上长度,y轴上长度),对应到数组中索引则是[y轴长度,x轴长度] image image

NarcissusInMirror commented 5 years ago

2019.7.26工作日志

目标检测

yolo v2 之车牌检测 yolo v2之车牌检测后续识别字符(一) yolo v2之车牌检测后续识别字符(二) face recognition[翻译][深度人脸识别:综述]

从RCNN到SSD,这应该是最全的一份目标检测算法盘点(机器之心) bounding box的loss求法(L2 loss和Smooth L1 loss)

FPN(feature pyramid networks)算法讲解

目标检测 YOLO v3 训练 人脸检测模型(有代码的,效果不好的人脸识别代码博客,csdn)

史上最详细的Yolov3边框预测分析(知乎) yolo系列之yolo v3【深度解析】(CSDN 彩色的YOLOv3结构示意图 内含YOLOv1和YOLOv2讲解链接) YOLO v3网络结构分析(上面一个链接之前找到的一篇csdn)

NarcissusInMirror commented 5 years ago

2019.8.7工作日志

Currently supported shells are:

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.


对于bash shell,此时输入命令`conda init bash`即可
* #### autosub的使用
NarcissusInMirror commented 5 years ago

2019.8.13工作日志

关于在实验室的人工智能平台上跑代码

如何创建一个docker镜像?docker和anaconda的关系?

NarcissusInMirror commented 5 years ago

2019.8.14工作日志

NarcissusInMirror commented 5 years ago

2019.8.27工作日志

卷积神经网络的压缩和加速(简书深度好文,卷积的底层实现)

CNN压缩与加速(包含了很多链接的知乎文)

Hdf5

Hierarchical Data Formats - What is HDF5?

The HDF5 format can be thought of as a file system contained and described within one single file.

NarcissusInMirror commented 5 years ago

2019.8.31

NarcissusInMirror commented 5 years ago

2019.9.4

LFW:Labeled Faces in the Wild CALFW:Cross Age LFW CPLFW:Cross Pose LFW CFP: Celebrities in Frontal Profile AgeDB: Age Database

NarcissusInMirror commented 5 years ago

宽广集群 宽广平台: 所有数据存放在/root下,/root目录是映射到一块硬盘下的,不同的镜像会共享这个硬盘,如果将数据存到了根目录/的其他文件夹下,每次打包镜像的时候会将数据一起打包,导致镜像文件很大

一个镜像相当于是一个操作系统,每次新建一个镜像就重装一遍系统 屏幕快照 2019-09-04 14 58 32 模版镜像几乎什么都没有,需要自己配

点击左上角的加号,会有容器的详细信息, 可以看到宿主机端口到容器机端口的映射,由于ssh连接的是22号端口,因此

NarcissusInMirror commented 5 years ago

sshfs配置

在mac上安装sshfs的过程中,会出现类似

The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local

的问题,解决方法如下链接 Homebrew Symlink Error image

chown命令的全拼是change owner,这里sudo chown -R $(whoami) /usr/local命令是将/usr/local目录权限给到当前用户,其中R代表递归,将改目录下所有文件权限给到当前用户。

使用命令

sshfs -p 22 root@antagus2:/var/www/vhosts ~/amazingweb -o auto_cache,reconnect,defer_permissions,noappledouble,volname=amazingweb
$ pgrep -lf sshfs # 查看进程
$ pkill -9 sshfs # 杀死进程 
# 如果上面两条之后还是不行
$ umount /Volume/96 

其中,-p指定端口,-o后跟了三个参数,意义如下 image 网址如下:Mac OS X: use SSHFS to mount a remote directory as a volume

NarcissusInMirror commented 5 years ago

rpm: Red hat Package Manager 是给centos用的!!!!

apt install 是给ubuntu用的

nohup python -u python_file.py &会默认在当前目录下生成一个nohup.out文件 使用tail -f filename实时显示文件

os.environ["CUDA_VISIBLE_DEVICES"] = "0, 1, 2"这句话只是设置了最多可以用的GPU数,要想实现多GPU并行还是需要写出相应的代码的。

NarcissusInMirror commented 5 years ago
NarcissusInMirror commented 5 years ago
NarcissusInMirror commented 5 years ago

nohup和&后台运行,进程查看及终止 其中,kill -9的意义: image

NarcissusInMirror commented 5 years ago

关于Accuracy、Precision和Recall见过最好的解释文章

NarcissusInMirror commented 4 years ago

2019.9.11工作日志

$ ip address add 10.106.130.66/21 dev eno2 # 设置网卡eno2的ip地址为10.106.130.66,子网掩码21位
$ ip route add default via 10.106.129.1 dev eno2# 设置默认网关为10.106.129.1
$ ip route add 10.0.0.0/8 via 10.106.128.1 dev eno2 # 访问10.0.0.0网段的地址走10.106.128.1路由

如果后两句颠倒会出现network unreachable的情况

NarcissusInMirror commented 4 years ago
NarcissusInMirror commented 4 years ago

Centos 安装mmpeg

sudo yum install epel-release -y
sudo yum update -y
sudo shutdown -r now # 重启生效

sudo rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

sudo yum install ffmpeg ffmpeg-devel -y

image

NarcissusInMirror commented 4 years ago

配置安装opencv2.4.13

cmake ../ -DCMAKE_BUILD_TYPE=RELEASE \
          -DCMAKE_INSTALL_PREFIX=/usr/local \ 
          -DBUILD_TIFF=ON \
          -DWITH_CUDA=ON \
          -DENABLE_FAST_MATH=1 \
          -DCUDA_FAST_MATH=1 \
          -DWITH_CUBLAS=1 \
          -DWITH_FFMPEG=1 \
          -DINSTALL_C_EXAMPLES=OFF \
          -DCUDA_GENERATION=Kepler \
          -DBUILD_opencv_cudacodec=OFF \
          -DENABLE_PRECOMPILED_HEADERS=OFF

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: opencv_dep_CUDA_nppi_LIBRARY

解决办法:修改FindCUDA.cmake, OpenCVDetectCUDA.cmake, common.hpp文件中的内容 下图中的内容可以不用改,由于版本原因在文件里可能找不到对应的语句 image

按照以上方法,cmake可以通过,但是make会报错nvcc fatal unsupported gpu architecture 'compute_20' opencv 解决办法:清空build文件夹,重新cmake,添加参数-DCUDA_GENERATION=Kepler

在68%左右出现fatal error: dynlink_nvcuvid.h: No such file or directory 解决方法 image

编译caffe

make: protoc: Command not found

image

跑验证程序 Check failed: error == cudaSuccess (209 vs. 0) no kernel image is available

解决办法

在Makefile.config文件中,将这一段代码

CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
             -gencode arch=compute_20,code=sm_21 \
             -gencode arch=compute_30,code=sm_30 \
             -gencode arch=compute_35,code=sm_35 \
             -gencode arch=compute_50,code=sm_50 \
             -gencode arch=compute_52,code=sm_52 \
             -gencode arch=compute_61,code=sm_61

替换为如下代码

CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
             -gencode arch=compute_35,code=sm_35 \
             -gencode arch=compute_50,code=sm_50 \
             -gencode arch=compute_52,code=sm_52 \
             -gencode arch=compute_60,code=sm_60 \
             -gencode arch=compute_61,code=sm_61 \
             -gencode arch=compute_61,code=compute_61

彻底删除numpy:

运行pip uninstall numpy,报错Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

解决方法:从/usr/lib64/python2.7/site-packages中将包含numpy的文件夹全部删除即可

NarcissusInMirror commented 4 years ago

2019.9.22工作日志

在anaconda中配置python2.7的虚拟环境,可以直接import caffe,除了以下问题: ImportError: No module named google.protobuf.internal 解决方法见网址 image 此处的/home/username/anaconda3/bin/pip是指定pip命令的位置