Sry to trouble you again. When I try to do evaluations based on the pretrained model on OneDrive, KeyError occurs:
(gas) vic@PC:~/GAS/GA-Sketching$ python generate_single.py -cat airplane -checkpoint 200
initialize network with normal
Loaded checkpoint from: /home/vic/GAS/GA-Sketching/core/../experiments/GASv64_airplane/checkpoints/checkpoint_epoch_200.tar
**checkpoint keys**: odict_keys(['volume_encoder.conv_in_0.weight', 'volume_encoder.conv_in_0.bias', 'volume_encoder.conv_in_1.weight', 'volume_encoder.conv_in_1.bias', 'volume_encoder.conv_in_bn.weight', 'volume_encoder.conv_in_bn.bias', 'volume_encoder.conv_in_bn.running_mean', 'volume_encoder.conv_in_bn.running_var', 'volume_encoder.conv_in_bn.num_batches_tracked', 'ifnet_encoder.conv_0.weight', 'ifnet_encoder.conv_0.bias', 'ifnet_encoder.conv_0_1.weight', 'ifnet_encoder.conv_0_1.bias', 'ifnet_encoder.conv_1.weight', 'ifnet_encoder.conv_1.bias', 'ifnet_encoder.conv_1_1.weight', 'ifnet_encoder.conv_1_1.bias', 'ifnet_encoder.conv_2.weight', 'ifnet_encoder.conv_2.bias', 'ifnet_encoder.conv_2_1.weight', 'ifnet_encoder.conv_2_1.bias', 'ifnet_encoder.conv_3.weight', 'ifnet_encoder.conv_3.bias', 'ifnet_encoder.conv_3_1.weight', 'ifnet_encoder.conv_3_1.bias', 'ifnet_encoder.conv0_1_bn.weight', 'ifnet_encoder.conv0_1_bn.bias', 'ifnet_encoder.conv0_1_bn.running_mean', 'ifnet_encoder.conv0_1_bn.running_var', 'ifnet_encoder.conv0_1_bn.num_batches_tracked', 'ifnet_encoder.conv1_1_bn.weight', 'ifnet_encoder.conv1_1_bn.bias', 'ifnet_encoder.conv1_1_bn.running_mean', 'ifnet_encoder.conv1_1_bn.running_var', 'ifnet_encoder.conv1_1_bn.num_batches_tracked', 'ifnet_encoder.conv2_1_bn.weight', 'ifnet_encoder.conv2_1_bn.bias', 'ifnet_encoder.conv2_1_bn.running_mean', 'ifnet_encoder.conv2_1_bn.running_var', 'ifnet_encoder.conv2_1_bn.num_batches_tracked', 'ifnet_encoder.conv3_1_bn.weight', 'ifnet_encoder.conv3_1_bn.bias', 'ifnet_encoder.conv3_1_bn.running_mean', 'ifnet_encoder.conv3_1_bn.running_var', 'ifnet_encoder.conv3_1_bn.num_batches_tracked', 'fc_0.weight', 'fc_0.bias', 'fc_1.weight', 'fc_1.bias', 'fc_2.weight', 'fc_2.bias', 'fc_out.weight', 'fc_out.bias'])
Traceback (most recent call last):
File "/home/vic/GAS/GA-Sketching/generate_single.py", line 23, in <module>
gen = Generator(net,
File "/home/vic/GAS/GA-Sketching/core/generator.py", line 17, in __init__
self.load_checkpoint(checkpoint)
File "/home/vic/GAS/GA-Sketching/core/generator.py", line 91, in load_checkpoint
self.model.load_state_dict(checkpoint['model_state_dict'])
KeyError: 'model_state_dict'
I print the checkpoint keys, is there something wrong with the way I load checkpoint?
I then change the code for loading the checkpoint to:
#self.model.load_state_dict(checkpoint['model_state_dict'])
state_dict = self.model.state_dict()
for k1, k2 in zip(state_dict.keys(), checkpoint.keys()):
state_dict[k1] = checkpoint[k2]
self.model.load_state_dict(state_dict)
(gas) vic@PC:~/GAS/GA-Sketching$ python generate_single.py -cat airplane -checkpoint 200
initialize network with normal
Loaded checkpoint from: /home/vic/GAS/GA-Sketching/core/../experiments/GASv64_airplane/checkpoints/checkpoint_epoch_200.tar
experiments/GASv64_airplane/evaluation_200@128_1v/
0it [00:00, ?it/s]
Traceback (most recent call last):
File "/home/vic/GAS/GA-Sketching/generate_single.py", line 31, in <module>
gen_iterator(out_path, dataset, gen)
File "/home/vic/GAS/GA-Sketching/core/generation_iterator.py", line 19, in gen_iterator
for i, data in tqdm(enumerate(loader)):
File "/home/vic/anaconda3/envs/gas/lib/python3.9/site-packages/tqdm/std.py", line 1182, in __iter__
for obj in iterable:
File "/home/vic/anaconda3/envs/gas/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__
data = self._next_data()
File "/home/vic/anaconda3/envs/gas/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 721, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/vic/anaconda3/envs/gas/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/vic/anaconda3/envs/gas/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/vic/GAS/GA-Sketching/core/data/voxelized_data_shapenet.py", line 225, in __getitem__
a0, e0, a1, e1, a2, e2 = self.dict[uid]
KeyError: '02691156/1b8e84935fdc3ec82be289de70e8db31'
Here I use the sketch you provided yesterday, I copy their uid to create a .lst file, I thought it might point to the sketch data you provided. My understanding about this program: the input is image and output is a corresponding mesh, so actually what I am confused here is where should I put my reference image for the model? What is the format of the input data?
Thanks!