detectRecog / PointTrack

PointTrack (ECCV2020 ORAL): Segment as Points for Efficient Online Multi-Object Tracking and Segmentation
Other
261 stars 47 forks source link

Strange missing arguments problem #5

Open lyuweiwang opened 4 years ago

lyuweiwang commented 4 years ago

Dear Author, When I run python test_tracking.py car_test_tracking_val, I met this problem:

Traceback (most recent call last): File "test_tracking.py", line 102, in embeds = model(points, None, xyxys, infer=True) File "/tmp-data/lyuwei/miniconda3/envs/pointtrack/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, **kwargs) TypeError: forward() missing 3 required positional arguments: 'points', 'labels', and 'xyxys'

However, as it shows, no argument is missing when I call forward function the same as your implementation. How can I solve this problem?

Thanks

detectRecog commented 4 years ago

I believe you did not generate the segmentation results. Before tracking, please generate the segmentation first. As we can see in 'datasets.KittiMOTSDataset.MOTSTrackCarsValOffset', at Line 198, segmentation results should be available at 'os.path.join(systemRoot, 'SpatialEmbeddings/car_SE_val_prediction')'.

lyuweiwang commented 4 years ago

I believe you did not generate the segmentation results. Before tracking, please generate the segmentation first. As we can see in 'datasets.KittiMOTSDataset.MOTSTrackCarsValOffset', at Line 198, segmentation results should be available at 'os.path.join(systemRoot, 'SpatialEmbeddings/car_SE_val_prediction')'.

I do generate with command python -u test_mots_se.py car_test_se_to_save. One thing to notice is that the pickle files are not saved in 'os.path.join(systemRoot, 'SpatialEmbeddings/car_SE_val_prediction')'. I found them in 'os.path.join(rootDir, 'car_SE_val_prediction')'. The files are named as "0006_237.pkl". Do I use the right directory? Moreover, the variables of points and xyxys have values.

lyuweiwang commented 4 years ago

I believe you did not generate the segmentation results. Before tracking, please generate the segmentation first. As we can see in 'datasets.KittiMOTSDataset.MOTSTrackCarsValOffset', at Line 198, segmentation results should be available at 'os.path.join(systemRoot, 'SpatialEmbeddings/car_SE_val_prediction')'.

If I do not generate the segmentation results, there will be no data in 'dataset_it'. Thus, 'embeds = model(points, None, xyxys, infer=True)' will not run because the loop 'for sample in dataset_it' is omitted.

RandomFool123 commented 4 years ago

@lyuweiwang Hi , I have the same problem as you. Because two of the four GPUs in the server are occupied, I try to change 4gpu parallelism into 2gpu parallelism in the code. But it still failed. Finally, the program can run normally after changing the multi GPU to a single GPU. But the result is a little strange, we can see that the indicators of 0013 video sequence seem to be incorrect.

QX46 { )%G8ON3D%5XGCN04

lyuweiwang commented 4 years ago

@RandomFool123 However, I only use one GPU.

RandomFool123 commented 4 years ago

@lyuweiwang You can try to set work_ nums=0 when loading data sets

lyuweiwang commented 4 years ago

Finally, I realized that "./pointTrack_weights/PointTrack.pthCar" should be copied to "./car_finetune_tracking/checkpoint.pth" before I run "test_tracking.py". So, the problem is caused because the model has no parameters.

lyuweiwang commented 4 years ago

@RandomFool123 My result is similar to yours. Maybe we should visualize the result of 0013.

image
tehseenmayar commented 3 years ago

@lyuweiwang Hi, I am also facing some strange error about check_point, i have correctly set the path to "pointTrack.pthCar" when i run "python test_tracking.py car_test_tracking_val". Can you tell what's causing this? @detectRecog Screenshot from 2021-05-21 20-03-50

XuqianRen commented 3 years ago

@tehseenmayar You need to change the path that load the segmentation result in datasets/KittiMOTSDataset.py line199, 200

duaaany commented 3 years ago

Finally, I realized that "./pointTrack_weights/PointTrack.pthCar" should be copied to "./car_finetune_tracking/checkpoint.pth" before I run "test_tracking.py". So, the problem is caused because the model has no parameters.

Hi. I have copyed "./pointTrack_weights/PointTrack.pthCar" to "./car_finetune_tracking/checkpoint.pth" . But it still met “TypeError: forward() missing 3 required positional arguments: 'points', 'labels', and 'xyxys'” when I run "python -u test_mots_se.py car_test_se_to_save". Do you know why? Thanks.

ShivaniSwadi commented 1 year ago

Hi. @detectRecog i tried to run the code (myenv) C:\Users\Bharath\PointTrack>python -u test_mots_se.py car_test_se_to_save but im getting this path error which i m unable to fix can you help me out.

File "C:\Users\Bharath\PointTrack\datasets\KittiMOTSDataset.py", line 129, in getitem sample = self.get_data_from_mots(index) File "C:\Users\Bharath\PointTrack\datasets\KittiMOTSDataset.py", line 118, in get_data_from_mots instance = Image.open(os.path.join(self.mots_instance_root, path)) File "C:\Users\Bharath\anaconda3\envs\myenv\lib\site-packages\PIL\Image.py", line 3131, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Bharath/PointTrack/kittiRoot/instance\kittiRoot/instance\0002\000000.png'

it is not taking the right path for the instance directory