- β‘β‘ Looking for full-time opportunities.
- π¬ Worked on object detection, domain adaptation, and vision-language models
- π Final year PhD student
vidit09 / domaingen Goto Github PK
View Code? Open in Web Editor NEWCLIP the Gap CVPR 2023
CLIP the Gap CVPR 2023
python demo.py --config-file configs/diverse_weather.yaml --input test.jpg --output D:/learning/domaingen-main/demoout --opts MODEL.WEIGHTS D:/learning/domaingen-main/model/diverse-weights.pth
An error occurred when I used a sentence like thisοΌdemo.py come from detectron2.
Traceback (most recent call last):
File "D:\learning\domaingen-main\demo.py", line 104, in
demo = VisualizationDemo(cfg)
File "D:\learning\domaingen-main\predictor.py", line 35, in init
self.predictor = DefaultPredictor(cfg)
File "d:\learning\detectron2-main\detectron2\engine\defaults.py", line 282, in init
self.model = build_model(self.cfg)
File "d:\learning\detectron2-main\detectron2\modeling\meta_arch\build.py", line 22, in build_model
model = META_ARCH_REGISTRY.get(meta_arch)(cfg)
File "D:\learning\domaingen-main\modeling\meta_arch.py", line 170, in init
super().init(cfg)
File "D:\learning\domaingen-main\modeling\meta_arch.py", line 26, in init
super().init(cfg)
File "d:\learning\detectron2-main\detectron2\config\config.py", line 189, in wrapped
explicit_args = _get_args_from_config(from_config_func, *args, **kwargs)
File "d:\learning\detectron2-main\detectron2\config\config.py", line 245, in _get_args_from_config
ret = from_config_func(*args, **kwargs)
File "d:\learning\detectron2-main\detectron2\modeling\meta_arch\rcnn.py", line 77, in from_config
"roi_heads": build_roi_heads(cfg, backbone.output_shape()),
File "d:\learning\detectron2-main\detectron2\modeling\roi_heads\roi_heads.py", line 43, in build_roi_heads
return ROI_HEADS_REGISTRY.get(name)(cfg, input_shape)
File "D:\learning\domaingen-main\modeling\roi_head.py", line 132, in init
super().init(cfg, input_shape)
File "D:\learning\domaingen-main\modeling\roi_head.py", line 51, in init
clsnames = MetadataCatalog.get(cfg.DATASETS.TRAIN[0]).get("thing_classes").copy()
AttributeError: 'NoneType' object has no attribute 'copy'
Thanks for your work!
In the Day Clear scene, I achieved an mAP of only 46.4%
, which differs from the reported mAP of 51.3%
in the research paper. I used two NVIDIA RTX 3090 GPUs for training and made some modifications to the train.py code to enable multiple GPU training.
if __name__ == "__main__":
args = default_argument_parser().parse_args()
print("Command Line Args:", args)
launch(
main,
args.num_gpus,
num_machines=args.num_machines,
machine_rank=args.machine_rank,
dist_url=args.dist_url,
args=(args,),
)
Additionally, in the run_step
function, I made the following changes:
opt_phase = False
if len(self.off_opt_interval) and self.iter >= self.off_opt_interval[0] and self.iter < self.off_opt_interval[0]+self.off_opt_iters:
if self.iter == self.off_opt_interval[0]:
self.model.module.offsets.data = torch.zeros(self.model.module.offsets.shape).cuda()
loss_dict_s = self.model.module.opt_offsets(data_s)
opt_phase = True
if self.iter+1 == self.off_opt_interval[0]+self.off_opt_iters:
self.off_opt_interval.pop(0)
Waiting for your early reply, thank you!
you need to add:
from fvcore.nn.precise_bn import get_bn_modules
in train.py and train_voc.py
Thank you for the great works! However, I couldn't find the Optimization Step in the code. Can you provide more context or point me to the specific section where the Optimization Step is supposed to be implemented?
When I run your code, I face a problem:
βββ
Traceback (most recent call last):
File "/home/gyang/data/domaingen/detectron2/detectron2/engine/train_loop.py", line 156, in train
self.after_step()
File "/home/gyang/data/domaingen/detectron2/detectron2/engine/train_loop.py", line 190, in after_step
h.after_step()
File "/home/gyang/data/domaingen/detectron2/detectron2/engine/hooks.py", line 299, in after_step
self._best_checking()
File "/home/gyang/data/domaingen/detectron2/detectron2/engine/hooks.py", line 272, in _best_checking
self._checkpointer.save(f"{self._file_prefix}", **additional_state)
File "/home/gyang/anaconda3/envs/det2/lib/python3.10/site-packages/fvcore/common/checkpoint.py", line 118, in save
data[key] = obj.state_dict()
File "/home/gyang/data/domaingen/train.py", line 429, in state_dict
ret = super().state_dict()
File "/home/gyang/data/domaingen/detectron2/detectron2/engine/defaults.py", line 498, in state_dict
ret["_trainer"] = self._trainer.state_dict()
File "/home/gyang/data/domaingen/detectron2/detectron2/engine/train_loop.py", line 425, in state_dict
ret["optimizer"] = self.optimizer.state_dict()
AttributeError: 'tuple' object has no attribute 'state_dict'
βββ
I am green for detection, would you mind give me some suggestion to fix this bug?
Hello, I'm wondering whether the model can be trained on multiple gpus.
If so, which part should I modify?
Thanks!
Hi! Thanks to this great work! I'm quite interested in the PCA visualization result but I encountered a weird problem. I found that under eval()
mode of RN101
based CLIP image encoder, the semantc augmentated feature (offests are extracted from the provided weights) located much far away from the source domain than the real target domain images' feature. The corresponding PCA visualization is shown below:
I wonder have your ever encounterd this problem?
Thanks in advance and looking forward to your replay!
Hello, when I running your code, it has errors following. What should I do?
Traceback (most recent call last):
File "/mnt/workspace/domaingen-main/train.py", line 601, in
main(args)
File "/mnt/workspace/domaingen-main/train.py", line 593, in main
trainer.train()
File "/mnt/workspace/detection/detect/detectron2/engine/defaults.py", line 486, in train
super().train(self.start_iter, self.max_iter)
File "/mnt/workspace/detection/detect/detectron2/engine/train_loop.py", line 156, in train
self.after_step()
File "/mnt/workspace/detection/detect/detectron2/engine/train_loop.py", line 190, in after_step
h.after_step()
File "/mnt/workspace/detection/detect/detectron2/engine/hooks.py", line 299, in after_step
self._best_checking()
File "/mnt/workspace/detection/detect/detectron2/engine/hooks.py", line 272, in _best_checking
self._checkpointer.save(f"{self._file_prefix}", **additional_state)
File "/opt/conda/envs/domain/lib/python3.9/site-packages/fvcore/common/checkpoint.py", line 118, in save
data[key] = obj.state_dict()
File "/mnt/workspace/domaingen-main/train.py", line 430, in state_dict
ret = super().state_dict()
File "/mnt/workspace/detection/detect/detectron2/engine/defaults.py", line 500, in state_dict
ret["_trainer"] = self._trainer.state_dict()
File "/mnt/workspace/detection/detect/detectron2/engine/train_loop.py", line 425, in state_dict
ret["optimizer"] = self.optimizer.state_dict()
AttributeError: 'tuple' object has no attribute 'state_dict'
Hello @vidit09,
In the saved .pth file of the model what are the weights of Va and Vb which are actually trained in the training phase?
I read your paper and it is a very good piece of work.
I would like to ask how PCA analysis is done. Can you provide the code?
Hello vidit,
I am working on zero shot object detection and i wanted to train your model while excluding one class for ex. bus and then try to to detect bus using ZSL.
can you please guide me how to modify the code so that bus is no longer considered while training.
PS:I have deleted bus objects from the XML files.
I want to know if this method can be applied to other areas, such as detecting fights or non-fight behaviors?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.