Closed yikakabu closed 5 years ago
Maybe you could use matplotlib to visualize the images that are being loaded by val_loader
?
The StopIteration error probably means val_loader
isn't loading any images. I would check that self.img_ids
in datasets.py is correct.
@jimmyyhwu Thanks for your reply. You are right. That is because my annotations in the json file had wrong format. I have already solved the issue and can start training now.
@jimmyyhwu Could you please explain the meaning of the parameter "object_scales" in generate_pose_lists.py. And how can I get the parameter from my own CAD model? Thanks very much.
object_scales = {
1: 0.3,
2: 0.3,
3: 0.2,
4: 0.2,
5: 0.7,
6: 0.2,
7: 0.2,
8: 0.3,
9: 0.3,
10: 0.2,
}
The object_scale
parameters are used to determine the position mean/cov when generating random positions here. Larger objects are usually further away from the camera. For example, the engine (scale=0.7) is much larger than the oil filter (scale=0.2). See object IDs here.
You will probably need to visually verify your rendered images and make sure the objects aren't too close or too far away.
@jimmyyhwu Thanks for your reply. Dose that means a appropriate distance from the object to camera? So, I should determine the scale of my model according to the size of the object. Do I understand that correctly?
Yes, it should roughly be proportional to the size of object. You can visually verify that the objects have appropriate sizes in the rendered images.
By the way, for further follow-up on this, it would be good to open a new, separate issue, since the object_scale
is not relevant to the "StopIteration" error originally referenced in this issue.
@jimmyyhwu I have understanded that. Thank you.
HI! Thank you for the great job. I created a json file of my own annotated data by following the coco mask.py. The part of the json file as below:
Then I modified the config file(drn_d_22_ChargePile.yml) and utils.py related to the object classes in "segmentation" folder. But when I run
There is a error "StopIteration" came out at:
first_input_batch, first_target_batch = iter(val_loader).next()
in the train.py:217 and RuntimeWarning: invalid value encountered in true_divide at:return np.diag(hist) / (hist.sum(1) + hist.sum(0) - np.diag(hist))
in the utils.py:25 It seems my dataset wasn't loaded correctly. Can you give me any suggestions about how to solve these problem?Thanks.