deep_sort_pytorch icon indicating copy to clipboard operation
deep_sort_pytorch copied to clipboard

train on the VeRi datasets,I got a normal increasing Acc on train but low on test

Open Y-Mona opened this issue 3 years ago • 17 comments

Firstly I processed the datasets

  1. i move the 0001_xxx.jpg to the folder train/0001(0001 is the name of the car)
  2. the same process on the test(the training data does not overlap the test )
  3. i modify the code in train.py(transform_train = torchvision.transforms.Compose([ torchvision.transforms.RandomCrap to transform_train = torchvision.transforms.Compose([ torchvision.transforms.Resize ) then i got the correct Acc on train , but which on test can hardly reach to 1%. most of the time, it only can reach to 0.6% could anyone can help me ?

Y-Mona avatar Apr 26 '21 11:04 Y-Mona

ok,I seek out the problem,the VeRi datasets assigned different cars in the training and test folder.for example, the car in train can be 1,3,5...but which in test may be 2,4,6...however,we need the same id in deepsort.so we need assign random imgs from training folder to a val folder which has the same structure as training folder

Y-Mona avatar Apr 30 '21 01:04 Y-Mona

ok,I seek out the problem,the VeRi datasets assigned different cars in the training and test folder.for example, the car in train can be 1,3,5...but which in test may be 2,4,6...however,we need the same id in deepsort.so we need assign random imgs from training folder to a val folder which has the same structure as training folder

could you tell me how to assign random imgs from training folder to a val folder which has the same structure as training folder?I‘m training VeRi datasets too.

DreamH313 avatar May 07 '21 06:05 DreamH313

you need know how to use python and the meaning of the name of the picture . set another folder named val. when you traverse the training folder , you get the Id(the last 4 digits of the img),and find out if there is a folder named Id in the val folder .if not, create one.then move it in .

Y-Mona avatar May 07 '21 09:05 Y-Mona

your structure should be like this : train ——0001 ——0002 vall ——0001 ——0002

Y-Mona avatar May 07 '21 09:05 Y-Mona

我英语水平也挺有限的,哪里不理想了,是我开头那个问题吗?你要把那个train.py的test改成val

Y-Mona avatar May 07 '21 13:05 Y-Mona

emmmm...那是要在data文件夹下再建立一个val文件夹然后内容和train文件夹里面的内容相同?? 我现在data文件夹下的内容就是这样,还要再建立一个val文件夹吗?那在train.py里又要怎么调用呢😂 111

DreamH313 avatar May 07 '21 13:05 DreamH313

在data下面新建一个val,里面的结构和train一样,也就是每个车分几个去val。注意这里要用move,不能复制,training 和val数据集的数据不能重合。train.py里面test改成val。后面看下这篇博客吧https://blog.csdn.net/weixin_40194996/article/details/104779138

Y-Mona avatar May 08 '21 02:05 Y-Mona

我其实就是看着这篇博客来做的😂发现效果不是很理想

DreamH313 avatar May 08 '21 02:05 DreamH313

他做法是对的,就是没说清楚。VeRi给的test是用来测试的,DeepSORT原本使用的数据集处理完之后的test其实就是val,所以这个项目的train.py用的test,命名方式不一样。所以你验证集就自己从train划出去,只是需要百度一下python如何移动文件和创建文件夹

Y-Mona avatar May 08 '21 06:05 Y-Mona

好的,谢谢,这是我迭代100次后的实验结果,我想知道您是否进行了类似的训练,是否得到了比我更好的训练结果 train

DreamH313 avatar May 08 '21 06:05 DreamH313

你看下这个项目作者的数据,最后val的Loss也要降低到和train差不多

Y-Mona avatar May 08 '21 07:05 Y-Mona

我头一次与人在GitHub上聊了这么多,非常感谢您!如果可以的话,我的qq邮箱已经在之前发过了,非常希望能添加您的qq好友进一步探讨,当然如果会造成您的某些困扰就算了,总之还是非常感谢!

DreamH313 avatar May 08 '21 07:05 DreamH313

我还没出现过这个问题,等我把自己的问题解决了会把项目上传到仓库的,博客得等毕设完了写

Y-Mona avatar May 18 '21 12:05 Y-Mona

your structure should be like this : train ——0001 ——0002 vall ——0001 ——0002

I am also trying to train Veri776 dataset with the train.py code. I have already modified the RandomCrop --> Resize part. HOWEVER, my train accuracy does not go above 5%. It is currently on epoch 15 so not going above 5% makes me wonder what is going on. In fact, it reached accuracy=4% at epoch 3...Any ideas?

By the way, my files look just like they should:

train ——0001 __________0001..X.jpg ————0001..X.jpg ——0002

test ——0001 __________0001..X.jpg ————0001..X.jpg ——0002

TomasMendozaHN avatar May 20 '21 02:05 TomasMendozaHN

I have not meet this question .sorry I can't help. where does your test comes from? It need to come from train folder. maybe you can see my repo https://github.com/Y-Mona/DeepSORT_Pytorch_VeRi and this blog https://blog.csdn.net/weixin_40194996/article/details/104779138

Y-Mona avatar May 21 '21 02:05 Y-Mona

I have not meet this question .sorry I can't help. where does your test comes from? It need to come from train folder. maybe you can see my repo https://github.com/Y-Mona/DeepSORT_Pytorch_VeRi and this blog https://blog.csdn.net/weixin_40194996/article/details/104779138

Thanks for your help! I was able to find out the problem: I was using a batch size that was too small and it made the network to suffer from noisy updates. My Accuracy has reached > 90% and it is still training.

TomasMendozaHN avatar May 21 '21 02:05 TomasMendozaHN

好的,谢谢,这是我迭代100次后的实验结果,我想知道您是否进行了类似的训练,是否得到了比我更好的训练结果 train

请问你这个问题解决了吗?我也遇到同样的问题,测试和训练的loss差别太大

xuaixi avatar Aug 23 '21 01:08 xuaixi