周报-240207

学习内容

本周进行了 SGNet 的配置运行,通过这个网络来寻找 SPNet 的问题


学习时间

2024.1.31 — 2024.2.6


学习笔记

SGNet 配置运行

[官网地址](GitHub - loicland/superpoint_graph: Large-scale Point Cloud Semantic Segmentation with Superpoint Graphs )

安装

先拉取 git 仓库

git clone --recurse-submodules https://github.com/loicland/superpoint_graph

安装 python 3.6.6 pytorch 1.4.0 CUDA 10.1(CUDA 安装自行下载)

# 创建虚拟环境
conda create -n sgnet python=3.6.6

conda activate sgnet

# torch 官网指令安装会有 bug,按以下指令安装
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn torch==1.4.0 torchvision==0.5.0

安装 torchnet

pip install --no-deps torchnet

安装其它依赖包、boost、eigen3

pip install future igraph tqdm transforms3d pynvrtc fastrlock cupy-cuda101 h5py scikit-learn plyfile scipy pandas

conda install -c anaconda boost; conda install -c omnia eigen3; conda install eigen; conda install -c r libiconv

安装 cut-pursuit (应该都已经装好了)看看 partition/cut-putsuit/ 有没有

没有的话执行:

cd partition
git submodule init
git submodule update --remote cut-pursuit 

编译 libply_c 库

cd ./partition/ply_c/

cmake . -DPYTHON_LIBRARY=/share/home/ncu_418000230023/anaconda3/envs/sgnet2/lib/libpython3.6m.so -DPYTHON_INCLUDE_DIR=/share/home/ncu_418000230023/anaconda3/envs/sgnet2/include/python3.6m -DBOOST_INCLUDEDIR=/share/home/ncu_418000230023/anaconda3/envs/sgnet2/include -DEIGEN3_INCLUDE_DIR=/share/home/ncu_418000230023/anaconda3/envs/sgnet2/include/eigen3

make

编译 cut-pursuit 库

cd ./partition/cut-pursuit/

cmake .. -DPYTHON_LIBRARY=/share/home/ncu_418000230023/anaconda3/envs/sgnet2/lib/libpython3.6m.so -DPYTHON_INCLUDE_DIR=/share/home/ncu_418000230023/anaconda3/envs/sgnet2/include/python3.6m -DBOOST_INCLUDEDIR=/share/home/ncu_418000230023/anaconda3/envs/sgnet2/include -DEIGEN3_INCLUDE_DIR=/share/home/ncu_418000230023/anaconda3/envs/sgnet2/include/eigen3

make
运行

下载官方的 s3dis 数据集,解压到 $S3DIS_DIR/data 中,然后运行以下代码

python partition/partition.py --dataset s3dis --ROOT_PATH $S3DIS_DIR --voxel_width 0.03 --reg_strength 0.03

provider.py 的 417 行缩进有问题,往前调整一格,报错信息:

Traceback (most recent call last):
  File "partition/partition.py", line 18, in <module>
    from provider import *
  File "/home/root_1/users/wkp/projects/python/superpoint_graph/partition/provider.py", line 417
    pcddata = pypcd.PointCloud.from_path(filename)
    ^
IndentationError: unexpected indent

遇到一些路径的问题,找不到 libply_c 和 libcp,把他们复制到能找到的路径就行了

还缺了库 pypcd,以及 cStringIO 在 python 3.x 中不使用的问题

pip install pypcd

# 修改导入 cStringIO 的代码
import cStringIO as sio
#改为
from io import StringIO as sio

出现问题,然后换到了 3090 上跑,没有出现这个问题,推测在 SPNet 上可能是 s3dis 数据集没有修复导致的,修复方法

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd

The above exception was the direct cause of the following exception:

SystemError: <built-in function __import__> returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
=================
   Area_1/
=================
1 / 44---> office_16
    creating the feature file...
/public/home/ncu_418000230023/anaconda3/envs/sgnet2/lib/python3.6/site-packages/sklearn/utils/validation.py:72: FutureWarning: Pass n_neighbors=1 as keyword args. From version 1.0 (renaming of 0.25) passing these as positional arguments will result in an error
  "will result in an error", FutureWarning)
        adding object 1 : clutter_24
        adding object 2 : wall_3
        adding object 3 : clutter_27
        adding object 4 : clutter_16
        adding object 5 : clutter_23
        adding object 6 : clutter_31
        adding object 7 : table_3
        adding object 8 : wall_1
        adding object 9 : wall_6
        adding object 10 : table_4
        adding object 11 : clutter_12
        adding object 12 : clutter_2
        adding object 13 : clutter_28
        adding object 14 : clutter_38
        adding object 15 : chair_3
        adding object 16 : clutter_8
        adding object 17 : clutter_10
        adding object 18 : table_1
        adding object 19 : clutter_29
        adding object 20 : wall_7
        adding object 21 : clutter_11
        adding object 22 : clutter_36
        adding object 23 : chair_6
        adding object 24 : beam_1
        adding object 25 : clutter_17
        adding object 26 : floor_1
        adding object 27 : chair_4
        adding object 28 : chair_2
        adding object 29 : chair_7
        adding object 30 : clutter_26
        adding object 31 : clutter_37
        adding object 32 : clutter_3
        adding object 33 : window_1
        adding object 34 : bookcase_1
        adding object 35 : board_1
        adding object 36 : clutter_21
        adding object 37 : clutter_39
        adding object 38 : table_5
        adding object 39 : wall_5
        adding object 40 : clutter_33
        adding object 41 : clutter_9
        adding object 42 : clutter_7
        adding object 43 : table_2
        adding object 44 : wall_2
        adding object 45 : chair_5
        adding object 46 : clutter_13
        adding object 47 : clutter_22
        adding object 48 : table_6
        adding object 49 : clutter_34
        adding object 50 : bookcase_2
        adding object 51 : clutter_4
        adding object 52 : clutter_6
        adding object 53 : clutter_35
        adding object 54 : clutter_15
        adding object 55 : clutter_14
        adding object 56 : clutter_19
        adding object 57 : ceiling_1
        adding object 58 : wall_8
        adding object 59 : clutter_32
        adding object 60 : clutter_18
        adding object 61 : clutter_20
        adding object 62 : clutter_5
        adding object 63 : wall_4
        adding object 64 : bookcase_3
        adding object 65 : clutter_1
        adding object 66 : chair_1
        adding object 67 : clutter_25
        adding object 68 : door_1
        adding object 69 : clutter_30
        adding object 70 : clutter_40
段错误 (核心已转储)

出现问题,发现字典 graph_nn 中,没有 distances 这个元素:

66 / 68---> storage_4
    reading the existing feature file...
    reading the existing superpoint graph file...
Timer :   0.0 /   0.0 /   0.0 
67 / 68---> office_23
    reading the existing feature file...
    reading the existing superpoint graph file...
Timer :   0.0 /   0.0 /   0.0 
68 / 68---> lobby_1
    reading the existing feature file...
    computing the superpoint graph...
Traceback (most recent call last):
  File "partition/partition.py", line 175, in <module>
    graph_nn["edge_weight"] = np.array(1. / ( args.lambda_edge_weight + graph_nn["distances"] / np.mean(graph_nn["distances"])), dtype = 'float32')
KeyError: 'distances'

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值