InternImage icon indicating copy to clipboard operation
InternImage copied to clipboard

Classification training on custom dataset

Open var316 opened this issue 1 year ago • 3 comments

Hi,

Thanks for the amazing work! I'm trying to train on custom dataset but seems like the classification code is specifically designed for Imagenet only. Is there a sample code for training on a custom dataset for classification?

Many thanks!

var316 avatar May 09 '23 12:05 var316

Did you solve the problem when training on custom dataset? I have FileNotFoundError: [Errno 2] No such file or directory: 'meta_data/train.txt' this issue.. Would be thankful for any help.

chungminho1 avatar Sep 13 '23 06:09 chungminho1

Hello, do you have an inference code for classifying a single image? If possible, could you please share it with me? I would greatly appreciate it.

unclelee97 avatar Jun 03 '24 03:06 unclelee97

Did you train with pretrained model? Did anyone succeed in fine-tuning?

jeonga0303 avatar Jun 11 '24 23:06 jeonga0303

@jeonga0303 是不是要修改InternImage/classification/meta_data/.json和map这俩个文件。

SpiderJack0516 avatar Oct 22 '24 07:10 SpiderJack0516

@czczup 大佬你好,是不是目前还不支持训练自己的分类数据。

SpiderJack0516 avatar Oct 22 '24 07:10 SpiderJack0516

@czczup 这是我的命令。python -m torch.distributed.run --nproc_per_node 4 --master_port 12345 main.py --cfg configs/internimage_h_22kto1k_512.yaml --batch-size 32 --pretrained ckpt/internimage_h_jointto22k_512.pth --data-path ./imagenet --output work_dirs_deepspeed config.json log_rank0.txt log_rank1.txt log_rank2.txt log_rank3.txt

SpiderJack0516 avatar Oct 22 '24 08:10 SpiderJack0516

@czczup 补充一下,我的命令是这个,刚才那个少了loacl-rank 这个参数,模型就加载到日志中的样子,后面就不动了。python -m torch.distributed.run --nproc_per_node 4 --master_port 12345 main.py --cfg configs/internimage_h_22kto1k_512.yaml --batch-size 32 --pretrained ckpt/internimage_h_jointto22k_512.pth --data-path ./imagenet --output work_dirs_deepspeed --local-rank 1

SpiderJack0516 avatar Oct 22 '24 08:10 SpiderJack0516

@jeonga0303 建议取消分布式训练。感觉那边问题很多,现在可以i正常跑。

SpiderJack0516 avatar Oct 23 '24 01:10 SpiderJack0516