2020-11-05

SiamRPN++代码ILSVRC 2015-VID数据集处理

SiamRPN++代码:https://github.com/PengBoXiangShang/SiamRPN_plus_plus_PyTorch

目录

SiamRPN++代码ILSVRC 2015-VID数据集处理

1.vim强制退出

2.wget: unable to resolve host address解决方法

3.Linux服务器ping命令

4.linux的rar压缩包解压

5.linux防火墙

6.imagenet-vid-2015数据集连接:百度网盘

 

7.# 4. Preprocess data.

8.fire包源码安装

8.1更改python3指向

8.2sudo: python3: command not found提示找不到python3

8.3subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.出了个小错误

9:再次处理数据集

1.create_dataset.py

2.create_lmdb.py


 

1.vim强制退出

保存并退出,wq

强制保存强制退出  wq!

不保存强制退出 q!

退出 q

2.wget: unable to resolve host address解决方法

sudo vim /etc/resolv.conf

添加
nameserver 8.8.8.8 #google域名服务器
nameserver 8.8.4.4 #google域名服务器

路由表:netstat -rn

增加网关:route add default gw 192.168.1.1 

DNS:grep hosts /etc/nsswitch.conf

3.Linux服务器ping命令

localhost:~ ds$ ping www.baidu.com 
ping: unknown host www.baidu.com 

百度:211.151.77.62

ping 211.151.77.62
PING 211.151.77.62 (211.151.77.62): 56 data bytes
64 bytes from 211.151.77.62: icmp_seq=0 ttl=229 time=55.231 ms

dns服务器 配置文件缺少nameserver

解决办法:参考2

4.linux的rar压缩包解压

将/etc 目录压缩为etc.rar                # rar a etc.rar /etc
将etc.rar 解压:                             # rar x etc.rar

5.linux防火墙

查看:systemctl status firewalld

关闭:systemctl stop firewalld

开机防火墙不启动: systemctl disable firewalld

ping: unknown host 解决办法
 
1.确定设置了dns cat /etc/resolv.conf 没有设置可以设置成google的nameserver 8.8.8.8
2.确保路由表正确netstat -rn 如果未设置, 则通过如下方式增加网关route add default gw 192.168.1.1 
3.确保dns正确 grep hosts /etc/nsswitch.conf 正确为hosts:      files dns

systemctl status firewalld查看当前防火墙状态。 systemctl stop firewalld关闭当前防火墙。 systemctl disable firewalld开机防火墙不启动。

找不到参考连接了

6.imagenet-vid-2015数据集连接:百度网盘

参考文献:https://blog.csdn.net/qq_17783559/article/details/106791934

链接:https://pan.baidu.com/s/15yIf37CinCZ1B8dy-caQ9Q 
提取码:ywc2

解压的时候报错,提示“你需要从上一压缩卷启动解压命令以便解压”,说明解压的文件为分卷压缩生成的压缩包,必须下载完整的压缩包到同一个文件夹

随便解压其中的一个压缩包

sudo rar e imagenet2015.part01.rar

解压完成后,生成imagenet_object_detection_video_train.tar.gz

再解压这个压缩包

tar zxvf imagenet_object_detection_video_train.tar.gz

 

7.# 4. Preprocess data.

lthpc@lthpc:/home/peng/Track/SiamRPN_plus_plus_PyTorch$ ./preprocessing/create_dataset.sh
python: can't open file 'create_dataset.py': [Errno 2] No such file or directory
lthpc@lthpc:/home/peng/Track/SiamRPN_plus_plus_PyTorch$ ls
config.py  data  dataloader  network  preprocessing  README.md  test.py  train.py  train.sh  utils
lthpc@lthpc:/home/peng/Track/SiamRPN_plus_plus_PyTorch$ cd preprocessing/
lthpc@lthpc:/home/peng/Track/SiamRPN_plus_plus_PyTorch/preprocessing$ ./create_dataset.sh
Traceback (most recent call last):
  File "create_dataset.py", line 13, in <module>
    from fire import Fire
ModuleNotFoundError: No module named 'fire'

8.fire包源码安装

下载地址

https://github.com/google/python-fire

找不到'termcolor' 包

sudo su
python-fire-master# python3 setup.py install
Couldn't find index page for 'termcolor' (maybe misspelled?)

下载安装

https://pypi.org/simple/termcolor/
tar zxvf termcolor-1.1.0.tar.gz
python-fire-master# python3 setup.py install
cd termcolor-1.1.0/
sudo su
python3 setup.py install
python-fire-master# python3 setup.py install

还是出错

./create_dataset.sh
ModuleNotFoundError: No module named 'fire'
python3 create_dataset.py --vid-dir /home/peng/Track/SiamRPN_plus_plus_PyTorch/data/VID/ILSVRC --output-dir /home/peng/data/VID_2015_RPN++
ModuleNotFoundError: No module named 'fire'
cd /home/peng/Track/SiamRPN_plus_plus_PyTorch/libarary/termcolor-1.1.0
sudo python3 setup.py install
cd /home/peng/Track/SiamRPN_plus_plus_PyTorch/libarary/python-fire-master
sudo python3 setup.py install

sudo rm -rf /home/peng/Track/SiamRPN_plus_plus_PyTorch/libarary/python-fire-master

cd /home/peng/Track/SiamRPN_plus_plus_PyTorch/preprocessing

cd /home/peng/Track/SiamRPN_plus_plus_PyTorch/libarary/fire-0.3.1
sudo python3 setup.py install

发现默认python3指向python3.5

(base) lthpc@lthpc:~$ python3.5
Python 3.5.2 (default, Jul 17 2020, 14:04:10)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fire
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>>
(base) lthpc@lthpc:~$

8.1更改python3指向

cd /usr/bin
ls -l | grep python
lrwxrwxrwx 1 root root            9 11月 25  2019 python3 -> python3.5
sudo rm /usr/bin/python3
sudo ln -s python3.7 python3
ls -l | grep python
lrwxrwxrwx 1 root root            9 11月  5 13:25 python3 -> python3.7

重新安装fire(切换到fire的源码下)

sudo python3 setup.py install
sudo: python3: command not found

8.2sudo: python3: command not found提示找不到python3

whereis python3
python3: /usr/bin/python3.5m /usr/bin/python3 /usr/bin/python3.5 
/usr/bin/python3.5m-config /usr/bin/python3.5-config 
/usr/lib/python3 /usr/lib/python3.5 /etc/python3 
/etc/python3.5 /usr/local/lib/python3.5 /usr/include/python3.5m 
/usr/include/python3.5 /usr/share/python3 
/opt/anaconda3-2019.3/bin/python3 /opt/anaconda3-2019.3/bin/python3.7m 
/opt/anaconda3-2019.3/bin/python3.7m-config /opt/anaconda3-2019.3/bin/python3.7 
/opt/anaconda3-2019.3/bin/python3.7-config /usr/share/man/man1/python3.1.gz

解决办法挂软链

ln -snf python3的路径  /usr/bin/python3
这里的 python3的路径是我们非root用户下安装的python3的路径
ln -snf python3的路径  /usr/bin/python3
sudo ln -snf /usr/share/python3  /usr/bin/python3
没反应
sudo ln -snf /opt/anaconda3-2019.3/bin/python3  /usr/bin/python3
成功

现在python3成功指向python3.7,重新安装fire(给python3.7安装)

sudo python3 setup.py install
Using /opt/anaconda3-2019.3/lib/python3.7/site-packages
Finished processing dependencies for fire==0.3.1

8.3subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.出了个小错误

pip list可以找到fire了
但是
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.

解决方法
sudo find / -name lsb_release
sudo rm -rf /usr/bin/lsb_release

重新执行处理数据

cd /home/peng/Track/SiamRPN_plus_plus_PyTorch/preprocessing
python3 create_dataset.py --vid-dir /home/peng/Track/SiamRPN_plus_plus_PyTorch/data/VID/ILSVRC --output-dir /home/peng/data/VID_2015_RPN++

成功

软链需要注意的地方

转自:https://blog.csdn.net/zhou_438/article/details/104339753

背景:之前是在自己用户非root用户安装的python3,但是有的时候执行需要在root下执行才能有权限,比如有的时候数据写入磁盘,我们必须要使用sudo python3而不是python3。root用户下之前未曾装过python3,所以我们执行sudo python3的时候就会出现:

sudo:python3: command not found
解决思路超级简单,我们在root下可以直接挂软链:

ln -snf python3的路径  /usr/bin/python3
说明:这里的 python3的路径是我们非root用户下安装的python3的路径

命令执行成功的话,我们可以在/usr/bin下看到python3的软链了

这样我们的root下也可以找到python3命令了

我们仔细可以发现在非root用户和root用户下使用命令echo $PATH运行的结果是不同的,因此我们没法直接在root下得到非root的命令。

9:再次处理数据集

1.create_dataset.py

cd /home/peng/Track/SiamRPN_plus_plus_PyTorch/preprocessing
python3 create_dataset.py --vid-dir /home/peng/Track/SiamRPN_plus_plus_PyTorch/data/VID/ILSVRC --output-dir /home/peng/data/VID_2015_RPN++

2.create_lmdb.py

python3 create_lmdb.py --data-dir /home/peng/data/VID_2015_RPN++ --output-dir /home/peng/data/VID_2015_RPN++.lmdb
100%|█████████████████████████████████████████████████████████| 4417/4417 [1:45:29<00:00,  8.17s/it]

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值