Hlings / AsyFOD

(CVPR2023) The PyTorch implementation of the "AsyFOD: An Asymmetric Adaptation Paradigm for Few-Shot Domain Adaptive Object Detection".
MIT License
33 stars 3 forks source link

without train_MMD.py #8

Closed 906096481 closed 8 months ago

906096481 commented 9 months ago

There is no train_MMD.py, but there is test_MMD.py. I get an error when I bring train_MMD.py from AcroFoD directly here. Is train_MMD.py used for small sample cross-domain target detection?

Hlings commented 9 months ago

Hi Please run with the train.py which is presented in this repo :)

906096481 commented 9 months ago

Hi Please run with the train.py which is presented in this repo :)

Hello, I have run train.py, but when I run test.py, I get an error. The error is: Traceback (most recent call last): File "test.py", line 324, in test(opt.data, File "test.py", line 90, in test _ = model(img.half() if half else img) if device.type != 'cpu' else None # run once File "/home/mllabs/anaconda3/envs/AcroFoD/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "/home/data3/WangBen/FSOD/AsyFOD-main/models/yolo_feature.py", line 144, in forward return self.forward_once(x, profile) # single-scale inference, train File "/home/data3/WangBen/FSOD/AsyFOD-main/models/yolo_feature.py", line 170, in forward_once return x, self.ranker(backbone_feature) File "/home/mllabs/anaconda3/envs/AcroFoD/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1207, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Model_feature' object has no attribute 'ranker'

Hlings commented 9 months ago

Oh sorry :(. I may forget to clean the text.py code. Please try to test using the test_MMD.py

906096481 commented 9 months ago

Hi, I have tried both and the error is the same.

Oh sorry :(. I may forget to clean the text.py code. Please try to test using the test_MMD.py

Hi, I have tried both and the error is the same.

906096481 commented 9 months ago

Oh sorry :(. I may forget to clean the text.py code. Please try to test using the test_MMD.py

Hi, I have tried both and the error is the same.

Hlings commented 9 months ago

Let me check

Hlings commented 9 months ago

Hi you run the test_MMD.py with a checkpoint?

906096481 commented 9 months ago

Hi you run the test_MMD.py with a checkpoint?

Yes, it is located in runs/train/exp/weights/best. Pt

Hlings commented 9 months ago

Is this checkpoint trained by AcroFOD or AsyFOD?

906096481 commented 9 months ago

Is this checkpoint trained by AcroFOD or AsyFOD? AsyFOD

906096481 commented 9 months ago

test.py works in AcroFOD, but this error occurs in AsyFOD.

Hlings commented 9 months ago

Yes. I think maybe there is a bug in not saving the parameters of the Ranker Module. And, the problem is you use the train.py in AsyFOD to train a model. The test performance can be successfully recorded during training but failing to test with the saved ckpt?

906096481 commented 9 months ago

Yes. I think maybe there is a bug in not saving the parameters of the Ranker Module. And, the problem is you use the train.py in AsyFOD to train a model. The test performance can be successfully recorded during training but failing to test with the saved ckpt?

It seems so.

Hlings commented 9 months ago

BTW Can you run detect_MMD.py or tsne code with the same checkpoint? I can run them sucessfully.

906096481 commented 9 months ago

BTW Can you run detect_MMD.py or tsne code with the same checkpoint? I can run them sucessfully.

Ok, thank you.

Hlings commented 9 months ago

You are welcome :) Feel free to ask me any questions. And please consider star these repos if you find them helpful thx!

906096481 commented 9 months ago

You are welcome :) Feel free to ask me any questions. And please consider star these repos if you find them helpful thx!

Hello, when I train my own data set, the target field sample number is only about 10, assuming I use 8 of them for training, how should my validation set fit the data?

Hlings commented 8 months ago

Hi. I answer this question in your newly posted issue :)