关于深度学习数据集和labels的一些问题

问题遇到的现象和发生背景

背景:
深度学习实验,使用WeaklySegPartialPoints框架(https://github.com/huiqu18/WeaklySegPartialPoints%EF%BC%89%EF%BC%8C%E6%95%B0%E6%8D%AE%E9%9B%86%E6%88%91%E6%98%AF%E7%94%A8%E7%9A%84%E6%98%AFcpm17

遇到的问题:
1.原WeaklySegPartialPoints论文和框架都使用了voronoi和cluster两种label,但我用的cpm17数据集并没有这种标注,应该怎么把原本数据及自带的标注文件(.mat)转换成框架和论文所需的labels?
2.怎么将图片生成一个train_val_test.json文件,达到main.py中要求的效果?(也即原框架readme的第二个步骤)
3.下文中提到的mean_std.npy文件是什么?怎么写?
4.用自己的数据集时,能不能直接根据./code_seg/options.py和./code_detection/options.py里面提到的文件夹名称,自己手动建好文件夹并且放好图片?(这也是我一开始尝试的做法)

问题相关代码,请勿粘贴截图

问题对应的代码:

1.在./code_seg/options.py中:

            self.train['label_vor_dir'] = '{:s}/labels_voronoi'.format(self.train['data_dir'])
            self.train['label_cluster_dir'] = '{:s}/labels_cluster'.format(self.train['data_dir'])

但原论文和原框架中并没有说这两类labels应该怎么生成。怎么把cpm17数据集的labels改成这两种特定的标注?

2.&3.
run.sh代码如下:

#!/usr/bin/env bash

ratio='0.10'
dataset='MO'
for repeat in 1 2
do
# detection
#cd ~/Research/TMI_weakly_seg/github/code_detection || exit,原代码
cd ~/autodl-tmp/WeaklySegPartialPoints/code_detection || exit
echo ${PWD}
python main.py --random-seed -1 --lr 0.0001 --batch-size 16 --epochs 80 \
  --gpus 0 --root-save-dir ../experiments/detection/${dataset}/${ratio}_repeat=${repeat}

# segmentation
#cd ~/Research/TMI_weakly_seg/github/code_seg || exit,原代码
cd ~/autodl-tmp/WeaklySegPartialPoints/code_seg || exit
echo ${PWD}
python main.py --random-seed -1 --lr 0.0001 --batch-size 8 --epochs 100 \
  --gpus 0 --save-dir ../experiments/segmentation/${dataset}/${ratio}_repeat=${repeat} \
  --detection-results-dir ../experiments/detection/${dataset}/${ratio}_repeat=${repeat}/3/best/images_prob_maps
done

在终端运行run.sh文件后报错:

File "main.py", line 30, in main
    with open('../data/{:s}/train_val_test.json'.format(opt.dataset), 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: '../data/MO/train_val_test.json'

File "main.py", line 56, in 
    main()
  File "main.py", line 14, in main
    opt.parse()
  File "/root/autodl-tmp/WeaklySegPartialPoints/code_seg/options.py", line 108, in parse
    'normalize': np.load('{:s}/mean_std.npy'.format(self.train['data_dir']))
  File "/root/miniconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 417, in load
    fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: '../data_for_train/MO/mean_std.npy'

原框架中唯一直接出现mean_std.npy是在./code_seg/options.py中:

self.transform['train'] = {
                'random_resize': [0.8, 1.25],
                'horizontal_flip': True,
                'vertical_flip': True,
                'random_affine': 0.3,
                'random_elastic_deform': [6, 15],
                'random_rotation': 90,
                'random_crop': self.train['input_size'],
                'label_encoding': [-1, -2],
                'to_tensor': 1,
                'normalize': np.load('{:s}/mean_std.npy'.format(self.train['data_dir']))
                #????
            }

怎么得到train_val_test.json和mean_std.npy文件?

4.
我自己在第一次尝试的时候,根据options.py里面出现的文件名,创建了训练集和验证集的文件夹并放好了images和labels,但不知道voronoi和cluster两个labels怎么写,怎么分

运行结果及报错内容

见上

我的解答思路和尝试过的方法

见上

我想要达到的结果

1.能用这个框架训练自己的数据集
2.希望能学到怎么分割数据及并生成json
3.希望能获得一些跑深度学习实验的实用经验,尽可能详细

你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。