heshuting555 / aicity2020_dmt_vehiclereid Goto Github PK
View Code? Open in Web Editor NEWThe 3rd Place Submission to AICity Challenge 2020 Track2
License: MIT License
The 3rd Place Submission to AICity Challenge 2020 Track2
License: MIT License
Sorry to bother you. Where can i get the bboxes ?
碰到上面这个问题,提示需要optimizer放在ls_scheduler前面:
“In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step()
before lr_scheduler.step()
.“
请问是调整什么位置呢?
Hi there,
I was trying your pre-trained model(resnet50_ibn_a_80.pth: https://drive.google.com/file/d/14TTv8mEECkRLgtmmTMY9BPc70rhgmXcu/view?usp=sharing) using configuration: configs/baseline_veri_r50_a.yml
.
And I made some little modification as I don't want to train it.
import os
from config import cfg
import argparse
from model import make_model
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="ReID Baseline Training")
parser.add_argument(
"--config_file", default="configs/baseline_veri_r50_a.yml", help="path to config file", type=str
)
parser.add_argument("opts", help="Modify config options using the command-line", default=None,
nargs=argparse.REMAINDER)
args = parser.parse_args()
if args.config_file != "":
cfg.merge_from_file(args.config_file)
cfg.merge_from_list(args.opts)
cfg.freeze()
os.environ['CUDA_VISIBLE_DEVICES'] = cfg.MODEL.DEVICE_ID
# train_loader, val_loader, num_query, num_classes = make_dataloader(cfg)
model = make_model(cfg, num_class=80)
model.load_param('resnet50_ibn_a_80.pth')
with torch.no_grad():
print(model(torch.zeros((1, 3, 224, 224))).shape)
However, I cannot load your model. The logging loads like this:
using resnet50_ibn_a as a backbone
Traceback (most recent call last):
File "try.py", line 30, in <module>
model = make_model(cfg, num_class=80)
File "AICITY2020_DMT_VehicleReID/model/make_model.py", line 124, in make_model
model = Backbone(num_class, cfg)
File "AICITY2020_DMT_VehicleReID/model/make_model.py", line 66, in __init__
self.base.load_param(model_path)
File "AICITY2020_DMT_VehicleReID/model/backbones/resnet_ibn_a.py", line 164, in load_param
self.state_dict()[i.replace('module.','')].copy_(param_dict[i])
KeyError: 'base.conv1.weight'
Do you have any idea of what is going on? Thanks for your help in advance.
RT, thanks. I just set _C.MODEL.COS_LAYER = True
你好,请问模型设置文件不兼容mmdet 2.x版本怎么解决?
作者你好, 我在阅读test-mining.py的时候,发现这一段难以理解.请问一下,这一段是起到什么作用呢?
num = 0
query_index = []
while num <= 3102:
if num == 0:
query_index.append(0)
num += 1
max_sum = 0
index_sum = []
for index in range(len(distmat)):
all_sum = 0
flag = True
if index not in query_index:
for index_q in query_index:
all_sum += distmat[index][index_q]
if distmat[index][index_q] < thresh:
flag = False
if all_sum > max_sum and flag:
max_sum = all_sum
index_sum.append(index)
if index_sum == []:
break
else:
index = index_sum.pop()
query_index.append(index)
num += 1
#print(num,'num')
你好!想知道完整的数据集应该在哪里下载呢,另外请问transformer的模型放置在哪里呢
你好,请问一下怎么用训练的模型测试自己的图片images_test
您好,
我在跑您的算法AICITY2020_DMT_VehicleReID的时候
执行test.py文件,报错Traceback (most recent call last):
File "/media/zq/train/code2/AICITY2020/test.py", line 43, in
train_loader, val_loader, num_query, num_classes = make_dataloader(cfg)
File "/media/zq/train/code2/AICITY2020/datasets/make_dataloader.py", line 53, in make_dataloader
dataset = __factory[cfg.DATASETS.NAMES](root=cfg.DATASETS.ROOT_DIR, plus_num_id=cfg.DATASETS.PLUS_NUM_ID)
File "/media/zq/train/code2/AICITY2020/datasets/aic_aicsim.py", line 31, in init
train = self._process_dir(self.train_dir, relabel=True)
File "/media/zq/train/code2/AICITY2020/datasets/aic_aicsim.py", line 71, in _process_dir
_, _, frame2trackID = self._process_track(path=self.train_track_path) #### Revised
File "/media/zq/train/code2/AICITY2020/datasets/aic_aicsim.py", line 121, in _process_track
file = open(path)
FileNotFoundError: [Errno 2] No such file or directory: '/media/zq/train/code2/data/AIC20_track2/AIC20_ReID/train_track_id.txt'
模型是您的预训练模型final_model/0409_3/resnet101_ibn_a_70.pth
cfg文件是 configs/baseline_aic_se.yml
这个train_track_id.txt文件是干啥的呀
为什么为执行测试命令,还需要train的文件
我下载的数据集是2021版本的,是因为数据集2020和2021的版本不一样吗?
Hi everyone,
Sorry for this kind of question, but I saw there is a train_track_id.txt file called at the training stage, but I do not have it, where can I find it?
Thank you in advance.
Hi,
Is there a way in your code to visualize the result of your model on the veri dataset?
python train.py --config_file='configs/baseline_aic.yml' OUTPUT_DIR "('/data/model/0402_5/')" ### here we get the model resnet101_ibn_a_80.pth in the 0402_5. 这个模型似乎训练后没有用到吗?
Hi!
I met an error when I run the code : File "...\triplet_loss.py", line 83, in hard_example_mining dist_an, relative_n_inds = torch.min( IndexError: min(): Expected reduction dim 1 to have non-zero size.
I don't know how to solve it. Can anyone help me?
你好!
run.sh前面两步:
python train.py --config_file='configs/baseline_aic.yml' OUTPUT_DIR "('/data/model/0402_5/')"
python train.py --config_file='configs/baseline_aic_finetune.yml' OUTPUT_DIR "('/data/model/0402_6/')"
我理解:
第一步是进行pre-train阶段,使用imagenet预训练模型,输出resnet101_ibn_a_80.pth
第二步是finetune阶段,使用resnet101_ibn_a_80.pth进行训练,冻结前两层,输出resnet101_ibn_a_40.pth
但是在baseline_aic_finetune.yml里,配置项
MODEL:
PRETRAIN_CHOICE: 'finetune'
PRETRAIN_PATH: '/data/model/0402_6/resnet101_ibn_a_40.pth'
这个PRETRAIN_PATH是不是写错了,应该是/0402_5/resnet101_ibn_a_80.pth? 否则在运行这个train之前,这个文件压根没有生成过?
谢谢!
Hi, I want to convert your pre trained model to .onnx and then try in another project. How I can convert .pth to .onnx?
Thanks.
AI City Challenge 2020 Track2 的数据集官网上已经不提供了,而且申请新的数据集也并未回复,请问能提供联系邮件或者开放的数据集吗?
Very nice project ! I compare with https://github.com/michuanhaohao/reid-strong-baseline/blob/master/configs/softmax_triplet.yml , and see some differences such as
IF_LABELSMOOTH: 'off' # origin is 'on'
SIZE_TRAIN: [320, 320] # origin is [256, 128]
OPTIMIZER_NAME: 'SGD' # origin is 'Adam'
MAX_EPOCHS: 40 # origin is 120
BASE_LR: 0.001 # origin is 0.00035
IMS_PER_BATCH: 96 # origin is 64
......
Can you share some experiences about how to choose these hyp? Thanks a lot !!
I tried this project under same dataset and config file, but this project's mAP and R1 is about 1% lower than the origin baseline. Will it be affected by the ignite lib ? Thanks !
I want to test this baseline on the VeRi-776.First I modified the '.yml' to my own path, then I modified 'veri.py',the root was modified to my own path 'root = "/home/zhang/D/LXF/AICITY2020_DMT_VehicleReID/data' in 'init',then I run 'python train.py --config_file='configs/baseline_veri_r50.yml' . the code reports a error "RuntimeError: '../data/VeRi' is not available
'" I ensure my path is right,and the dataset veri is available.why ? thank you
Hi @heshuting555 ! thanks for your great work!
When I try to train the VeRi-776 dataset, I met a error.
python train.py --config_file='configs/baseline_veri_r50_a.yml' MODEL.DEVICE_ID "('3')" OUTPUT_DIR "('log/')"
the following is the result
Traceback (most recent call last):
File "train.py", line 62, in <module>
model = make_model(cfg, num_class=num_classes)
File "/data/DMT/model/make_model.py", line 126, in make_model
model = Backbone(num_class, cfg)
File "/data/DMT/model/make_model.py", line 67, in __init__
self.base.load_param(model_path)
File "/data/DMT/model/backbones/resnet_ibn_a.py", line 164, in load_param
self.state_dict()[i.replace('module.','')].copy_(param_dict[i])
KeyError: 'base.conv1.weight'
I used your weights resnet50_ibn_a_80.pth
Could you please help me? Thank you very much!
Hi, I have a question about loading query and gallery for AI-City dataset.
Why for query and gallery images, you set camid
to 1 and pid
to 2 in datasets/aic.py
?
Is there any reason for that?
Thanks for helping!
def _process_dir_test(self, dir_path, relabel=False, query=True):
img_paths = sorted(glob.glob(osp.join(dir_path, '*.jpg')))
dataset = []
_, _, frame2trackID = self._process_track(path=self.test_track_path)
for img_path in img_paths:
camid = 1
pid = 2
if query:
dataset.append((img_path, pid, camid, -1))
else:
trackid = frame2trackID[int(img_path[-10:-4])]
dataset.append((img_path, pid, camid, trackid))
#print(len(dataset), 'len(dataset)')
return dataset
您好,请问如何生成track2.txt文件
RT. Thanks!
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.