Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443... failed

问题描述:这里需要下载kitti的3D检测数据,从一个raw.githubusercontent.com的网站上进行wget下载txt文件,但是返回无法访问的错误。Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443… failed: Connection refused.

解决方法
1)通过ip查询网站(https://site.ip138.com/raw.Githubusercontent.com/),查找raw.githubusercontent.com的IP地址

Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443... failed_第1张图片

2)在linux的 /etc/hosts 路径上,添加上诉查询到的IP,sudo vi /etc/hosts

Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443... failed_第2张图片

此时,发现raw.githubusercontent.com可以正常ping通,重新执行命令:

wget -c  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/test.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/test.txt

可以正常执行,问题解决。

执行过程


```python
(base) lab@user-AS-5014A-TT:~/LLC/PointCloud$ wget -c  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/test.txt
--2022-10-12 10:21:16--  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/test.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.110.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 52625 (51K) [text/plain]
Saving to: ‘test.txt’
test.txt                      100%[===============================================>]  51.39K  --.-KB/s    in 0.08s
2022-10-12 10:21:16 (672 KB/s) - ‘test.txt’ saved [52625/52625]

(base) lab@user-AS-5014A-TT:~/LLC/PointCloud/mmdetection3d$ wget -c  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/trainval.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/trainval.txt
--2022-10-12 10:27:05--  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/trainval.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 52366 (51K) [text/plain]
--2022-10-12 10:27:05--  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/trainval.txt
Reusing existing connection to raw.githubusercontent.com:443.
HTTP request sent, awaiting response... 200 OK
Length: 52366 (51K) [text/plain]
Saving to: ‘./data/kitti/ImageSets/trainval.txt’
./data/kitti/ImageSets/trainv 100%[===============================================>]  51.14K  --.-KB/s    in 0.08s
2022-10-12 10:27:06 (643 KB/s) - ‘./data/kitti/ImageSets/trainval.txt’ saved [52366/52366]

(base) lab@user-AS-5014A-TT:~/LLC/PointCloud/mmdetection3d$ wget -c  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/val.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/val.txt
--2022-10-12 10:26:58--  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/val.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26382 (26K) [text/plain]
--2022-10-12 10:26:58--  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/val.txt
Reusing existing connection to raw.githubusercontent.com:443.
HTTP request sent, awaiting response... 200 OK
Length: 26382 (26K) [text/plain]
Saving to: ‘./data/kitti/ImageSets/val.txt’
./data/kitti/ImageSets/val.tx 100%[===============================================>]  25.76K  --.-KB/s    in 0.02s
2022-10-12 10:26:58 (1.04 MB/s) - ‘./data/kitti/ImageSets/val.txt’ saved [26382/26382]

(base) lab@user-AS-5014A-TT:~/LLC/PointCloud/mmdetection3d$ wget -c  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/trainval.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/trainval.txt
--2022-10-12 10:27:05--  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/trainval.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 52366 (51K) [text/plain]
--2022-10-12 10:27:05--  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/trainval.txt
Reusing existing connection to raw.githubusercontent.com:443.
HTTP request sent, awaiting response... 200 OK
Length: 52366 (51K) [text/plain]
Saving to: ‘./data/kitti/ImageSets/trainval.txt’
./data/kitti/ImageSets/trainv 100%[===============================================>]  51.14K  --.-KB/s    in 0.08s
2022-10-12 10:27:06 (643 KB/s) - ‘./data/kitti/ImageSets/trainval.txt’ saved [52366/52366]

感觉这个方法对于xxx.com 无法访问同样可以使用。


参考资料

Ubuntu下连接raw.githubusercontent.com失败

你可能感兴趣的:(Debug,python,linux,开发语言)