-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
finetune have bug!!ValueError: char_to_token() is not available when using Python based tokenizers #90
Comments
instruction: CUDA_VISIBLE_DEVICES=6,7 python -m torch.distributed.launch --nproc_per_node=2 --use_env main.py --dataset_config configs/refcoco.json --batch_size 4 --load /data_SSD1/lhxiao/mdetr/checkpoint/pretrain/pretrained_resnet101_checkpoint.pth --ema --text_encoder_lr 1e-5 --lr 5e-5 |
env:Name Version Build Channel_libgcc_mutex 0.1 conda_forge https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge |
same bug. Do you fix it? |
Start training...
Starting epoch 0
/home/mmc_xiaolinhui/mmc_226_exp_202206/mdetr/models/position_encoding.py:41: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
dim_t = self.temperature ** (2 * (dim_t // 2) / self.num_pos_feats)
/home/mmc_xiaolinhui/mmc_226_exp_202206/mdetr/models/position_encoding.py:41: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
dim_t = self.temperature ** (2 * (dim_t // 2) / self.num_pos_feats)
Traceback (most recent call last):
File "main.py", line 631, in
args = parser.parse_args()
File "main.py", line 533, in main
sampler_train.set_epoch(epoch)
File "/home/mmc_xiaolinhui/mmc_226_exp_202206/mdetr/engine.py", line 73, in train_one_epoch
loss_dict.update(criterion(outputs, targets, positive_map))
File "/home/mmc_xiaolinhui/anaconda3/envs/mdetr_env/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/home/mmc_xiaolinhui/mmc_226_exp_202206/mdetr/models/mdetr.py", line 569, in forward
losses.update(self.get_loss(loss, outputs, targets, positive_map, indices, num_boxes))
File "/home/mmc_xiaolinhui/mmc_226_exp_202206/mdetr/models/mdetr.py", line 516, in get_loss
return loss_map[loss](outputs, targets, positive_map, indices, num_boxes, **kwargs)
File "/home/mmc_xiaolinhui/mmc_226_exp_202206/mdetr/models/mdetr.py", line 399, in loss_contrastive_align
beg_pos = tokenized.char_to_token(i, beg)
File "/home/mmc_xiaolinhui/anaconda3/envs/mdetr_env/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 547, in char_to_token
raise ValueError("char_to_token() is not available when using Python based tokenizers")
ValueError: char_to_token() is not available when using Python based tokenizers
The text was updated successfully, but these errors were encountered: