The wrong outputs of the pre-trained model
MezereonXP opened this issue · 7 comments
Hi,Jia
I have cloned the repo and downloaded your first pre-trained model(DSGN_car_pretrained.zip). Then I run the code on my kitti dataset, but I got the result which just consists of the cyclist and pedestrians.
And, I also tried to apply another model (dsgn_12g_b). I got the result for 'car' successfully but the position, dimension, or orientation are almost wrong.
My environment follows your requirements (python==3.7.0, pytorch==1.1.0, torchvision==2.2.0).
Could you please give me some tips?
Thanks.
I did not run the 'tools/generate_targets.py'. Is that serious for inference?
It's weird. You do not have to generate the training target.
Could you show me the log file and the prediction result?
Sure.
For the dsgn_12g_b model:
my shell is
python tools/test_net.py --loadmodel ./outputs/dsgn_12g_b/ -btest 4 -d 0
the log likes:
depth: 2.0 -> 40.400000000000006
z range: 40.4 -> 2.0
GRID SIZE [192, 20, 304]
CV GRID SIZE [192, 384, 1248]
Using GPU:0
split_txt in /opt/kxp/workspace/ar-projects/DSGN/dsgn/dataloader/../../data/kitti/./trainval.txt has 7481 samples
split_txt in /opt/kxp/workspace/ar-projects/DSGN/dsgn/dataloader/../../data/kitti/./test.txt has 3712 samples
split_txt in /opt/kxp/workspace/ar-projects/DSGN/dsgn/dataloader/../../data/kitti/./train.txt has 3712 samples
split_txt in /opt/kxp/workspace/ar-projects/DSGN/dsgn/dataloader/../../data/kitti/./val.txt has 3769 samples
------------------------------ Load Nothing ---------------------------------
Number of model parameters: 8054422
/opt/kxp/.conda/envs/dsgn/lib/python3.7/site-packages/torch/nn/functional.py:2457: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
Wrote 1
Wrote 2
Wrote 4
Wrote 5
time = 2.82
Mean depth error(m): 9.847219467163086 Median(m): 9.764020919799805 (batch 4)
Wrote 6
Wrote 8
Wrote 15
Wrote 19
time = 2.50
Mean depth error(m): 10.914083480834961 Median(m): 11.104022979736328 (batch 4)
the output file (000001.txt in .../kitti_output/) likes:
Car -1 -1 0.7713 795.8355 160.5147 848.4035 189.2286 1.437421 0.804717 2.874761 10.969433 0.820072 37.566391 1.055404 0.99999952
Car -1 -1 1.4406 790.0738 196.9382 805.6260 220.5161 0.922338 0.253471 3.368236 8.627239 2.092493 33.356224 1.693714 0.99999952
Car -1 -1 1.9947 725.5353 154.6523 752.7966 182.6154 1.347366 0.877533 1.271348 6.329060 0.470699 35.536068 2.170906 0.99999928
Car -1 -1 0.8650 721.1917 157.3688 741.2639 173.0639 0.668662 0.328280 0.933826 5.200974 0.009301 31.221889 1.030110 0.99999845
Car -1 -1 1.1215 738.0797 157.0592 803.3547 178.2593 0.962491 2.317269 2.111040 7.511338 0.245759 34.049099 1.338669 0.99999845
Car -1 -1 1.7561 758.9996 137.9064 807.9376 233.6581 3.507333 1.638736 1.007644 6.506024 2.227580 27.220884 1.990719 0.99999821
Car -1 -1 1.1963 720.5629 160.8844 772.8956 179.0573 0.792477 1.714626 1.978419 6.107758 0.270870 32.594498 1.381561 0.99999821
Car -1 -1 1.5391 758.6766 159.0310 786.8074 199.9377 0.966558 0.551688 5.372473 4.352037 0.640301 19.737051 1.756103 0.99999809
Car -1 -1 1.2944 702.0197 158.7995 732.0284 206.6478 2.123939 0.397040 3.671032 4.948000 1.500429 33.871296 1.439419 0.99999797
Car -1 -1 0.9213 820.9614 177.0863 833.5846 202.3756 1.086354 0.244227 0.546993 9.410988 1.272610 31.391302 1.212577 0.99999785
Car -1 -1 1.0174 734.4626 167.0035 816.9658 198.4806 1.381149 2.156137 3.647347 7.629927 1.124800 33.731800 1.239831 0.99999774
Car -1 -1 1.3767 762.5917 198.4482 785.2674 221.7435 0.936469 0.559827 2.329816 7.383217 2.140240 32.751015 1.598409 0.99999762
Car -1 -1 1.3152 754.8799 169.7105 773.6621 209.9546 1.675279 0.281894 2.030873 6.586266 1.544779 31.054287 1.524155 0.99999738
Car -1 -1 1.1813 804.8268 138.8653 867.3504 187.5978 1.880308 1.882262 1.668442 8.935102 0.569237 28.751078 1.482624 0.99999702
Car -1 -1 0.7119 712.7296 154.2937 735.4590 201.7777 2.383970 0.708612 0.900584 5.779553 1.452493 36.795170 0.867747 0.99999702
Car -1 -1 1.5770 745.6062 125.1722 786.3351 196.8886 2.761077 1.541669 2.963811 6.313591 0.925689 29.389881 1.788591 0.99999690
Car -1 -1 1.6953 744.8560 175.3983 767.4861 196.9596 0.925593 0.417747 5.116430 6.896665 1.054818 34.051167 1.895124 0.99999690
Car -1 -1 1.4832 250.4353 158.9643 278.6954 252.0421 3.503667 0.888429 1.116033 -13.389030 2.981182 27.864204 1.035236 0.99999678
Car -1 -1 1.2587 720.8164 150.6418 734.9503 191.3856 2.049905 0.206161 1.691195 6.024869 0.932722 37.150772 1.419497 0.99999654
Car -1 -1 1.5919 780.0500 160.6616 803.1821 185.2330 1.035472 0.919408 5.339076 8.331857 0.522025 33.099918 1.838520 0.99999630
Car -1 -1 0.7075 716.3983 157.4086 755.8654 185.0853 1.200572 1.284169 1.182423 5.581122 0.530933 32.161278 0.879292 0.99999619
Car -1 -1 1.4243 776.9763 139.9128 806.5868 255.5222 3.823991 0.667052 2.253258 6.235192 2.734759 25.017212 1.668532 0.99999595
Car -1 -1 1.0254 735.0802 151.1132 793.3577 242.6989 3.428955 0.680482 3.221853 6.023705 2.615341 28.644087 1.232691 0.99999547
Car -1 -1 0.7586 803.2533 167.0875 831.1688 201.6405 1.533153 0.627928 1.076073 9.327287 1.277646 32.635593 1.036981 0.99999523
Car -1 -1 0.7720 721.7689 150.4809 801.5189 196.5932 1.619247 1.737870 2.351246 5.561547 0.833966 26.794827 0.976653 0.99999499
Car -1 -1 0.9333 717.3063 151.2362 751.6642 191.3181 1.993440 0.948414 1.619863 6.303309 0.918655 36.819084 1.102812 0.99999440
Car -1 -1 1.0789 853.8187 180.9440 932.6421 201.5263 0.460227 0.389483 3.356081 7.379708 0.694251 19.148298 1.446734 0.99999440
Car -1 -1 -0.5446 747.1926 224.4317 834.6289 242.1125 0.458503 0.977993 2.809558 6.156856 2.290945 24.743782 -0.300680 0.99999428
Car -1 -1 0.7815 791.9025 161.6617 834.5107 189.4316 1.247680 0.691608 1.989306 9.361689 0.745175 33.451099 1.054405 0.99999416
Car -1 -1 1.4257 710.0640 163.6126 745.0941 198.9311 1.221796 0.699883 4.047143 4.305368 0.902460 26.985872 1.583884 0.99999380
But the ground truth likes:
Truck 0.00 0 -1.57 599.41 156.40 629.75 189.25 2.85 2.63 12.34 0.47 1.49 69.44 -1.56
Car 0.00 0 1.85 387.63 181.54 423.81 203.12 1.67 1.87 3.69 -16.53 2.39 58.49 1.57
Cyclist 0.00 3 -1.65 676.60 163.95 688.98 193.93 1.86 0.60 2.02 4.59 1.32 45.84 -1.55
DontCare -1 -1 -10 503.89 169.71 590.61 190.13 -1 -1 -1 -1000 -1000 -1000 -10
DontCare -1 -1 -10 511.35 174.96 527.81 187.45 -1 -1 -1 -1000 -1000 -1000 -10
DontCare -1 -1 -10 532.37 176.35 542.68 185.27 -1 -1 -1 -1000 -1000 -1000 -10
DontCare -1 -1 -10 559.62 175.83 575.40 183.15 -1 -1 -1 -1000 -1000 -1000 -10
Thanks for your reply.
I think the problem is that the command line should specify the model path.
python tools/test_net.py --loadmodel ./outputs/dsgn_12g_b/finetune_48.tar -btest 4 -d 0
Could you try it again?
Besides, since the pre-defined region in this network only ranges from 2m to 40m. And the 000001.txt has one car instance which is 58m > 40m. So the prediction result should be empty for 000001.
I just found a bug when loading the newly uploaded model weight dsgn_12g_b and update the code. You can check the commit history
I really appreciate your help!
After updating the code and changing the command,I have got the correct results!
Thanks again,
Ke