ranahanocka / MeshCNN

Convolutional Neural Network for 3D meshes in PyTorch
MIT License
1.56k stars 314 forks source link

ValueError: index can't contain negative values #60

Open christinezuzart opened 4 years ago

christinezuzart commented 4 years ago

Hi,

During training I am getting the below error.


meshcnn) C:\ml_work\MeshCNN>python train.py --dataroot datasets/mydataset --name mydataset --ncf 64 128 256 256 --pool_res 600 450 300 180 --norm group --resblocks 1 --flip_edges 0.2 --slide_verts 0.2 --num_aug 20 --niter_decay 100 \
------------ Options -------------
arch: mconvnet
batch_size: 16
beta1: 0.9
checkpoints_dir: ./checkpoints
continue_train: False
dataroot: datasets/mydataset
dataset_mode: classification
epoch_count: 1
export_folder:
fc_n: 100
flip_edges: 0.2
gpu_ids: [0]
init_gain: 0.02
init_type: normal
is_train: True
lr: 0.0002
lr_decay_iters: 50
lr_policy: lambda
max_dataset_size: inf
name: mydataset
ncf: [64, 128, 256, 256]
ninput_edges: 750
niter: 100
niter_decay: 100
no_vis: False
norm: group
num_aug: 20
num_groups: 16
num_threads: 3
phase: train
pool_res: [600, 450, 300, 180]
print_freq: 10
resblocks: 1
run_test_freq: 1
save_epoch_freq: 1
save_latest_freq: 250
scale_verts: False
seed: None
serial_batches: False
slide_verts: 0.2
verbose_plot: False
which_epoch: latest
-------------- End ----------------
computing mean std from train data...
Traceback (most recent call last):
File "train.py", line 10, in <module>
dataset = DataLoader(opt)
File "C:\ml_work\MeshCNN\data\__init__.py", line 21, in __init__
self.dataset = CreateDataset(opt)
File "C:\ml_work\MeshCNN\data\__init__.py", line 12, in CreateDataset
dataset = ClassificationData(opt)
File "C:\ml_work\MeshCNN\data\classification_data.py", line 19, in __init__
self.get_mean_std()
File "C:\ml_work\MeshCNN\data\base_dataset.py", line 32, in get_mean_std
for i, data in enumerate(self):
File "C:\ml_work\MeshCNN\data\classification_data.py", line 31, in __getitem__
edge_features = pad(edge_features, self.opt.ninput_edges)
File "C:\ml_work\MeshCNN\util\util.py", line 22, in pad
return np.pad(input_arr, pad_width=npad, mode='constant', constant_values=val)
File "<__array_function__ internals>", line 6, in pad
File "C:\Users\christine.zuzart\AppData\Local\conda\conda\envs\meshcnn\lib\site-packages\numpy\lib\arraypad.py", line 748, in pad
pad_width = _as_pairs(pad_width, array.ndim, as_index=True)
File "C:\Users\christine.zuzart\AppData\Local\conda\conda\envs\meshcnn\lib\site-packages\numpy\lib\arraypad.py", line 519, in _as_pairs
raise ValueError("index can't contain negative values")
ValueError: index can't contain negative values

(meshcnn) C:\ml_work\MeshCNN>



Please note that
- Meshes are to same number of faces = 2000
- Dataset - Self created from manufacturable 3D CAD files
ranahanocka commented 4 years ago

Hi @christinezuzart ,

Note the argument ninput_edges: 750 does not agree with faces = 2000 (which corresponds to 3000 edges). You need to set --ninput_edges 3000

You should also increase the pool_res as I discussed with you in the other issue.

changhui666 commented 2 years ago

The number of edges divided by the number of faces is not 3:2 when Using the script/dataprep/blender_process.py

IvanGarcia7 commented 1 year ago

Any solution? I have several .obj models with 2000 vertex and 3988 faces.