wfs123456/CCTrans

TypeError: '>' not supported between instances of 'type' and 'float'

Opened this issue · 4 comments

作者你好,可以帮我看一下这个问题要如何解决吗?
CUDA_DEVICE_ORDER=PCI_BUS_ID
CUDA_VISIBLE_DEVICES=0
number of img [train]: 0
number of img [val]: 13
2023-03-04 21:08:32,599 - INFO - data_dir : ./ShanghaiTech/ShanghaiTech/part_A_final
2023-03-04 21:08:32,599 - INFO - dataset : sha
2023-03-04 21:08:32,600 - INFO - lr : 1e-05
2023-03-04 21:08:32,600 - INFO - weight_decay : 0.0001
2023-03-04 21:08:32,600 - INFO - resume :
2023-03-04 21:08:32,600 - INFO - max_epoch : 4000
2023-03-04 21:08:32,600 - INFO - val_epoch : 1
2023-03-04 21:08:32,600 - INFO - val_start : 0
2023-03-04 21:08:32,600 - INFO - batch_size : 16
2023-03-04 21:08:32,600 - INFO - device : 0
2023-03-04 21:08:32,601 - INFO - num_workers : 16
2023-03-04 21:08:32,601 - INFO - crop_size : 256
2023-03-04 21:08:32,601 - INFO - wot : 0.1
2023-03-04 21:08:32,601 - INFO - wtv : 0.01
2023-03-04 21:08:32,601 - INFO - reg : 10.0
2023-03-04 21:08:32,601 - INFO - num_of_iter_in_ot: 100
2023-03-04 21:08:32,601 - INFO - norm_cood : 0
2023-03-04 21:08:32,601 - INFO - run_name : CCTrans
2023-03-04 21:08:32,601 - INFO - wandb : 0
2023-03-04 21:08:32,728 - INFO - using 1 gpus
Traceback (most recent call last):
File "train.py", line 67, in
trainer.setup()
File "/share/home/wut_pansk/CCTrains/train_helper_ALTGVT.py", line 123, in setup
self.model = ALTGVT.alt_gvt_large(pretrained=True)
File "/share/home/wut_pansk/CCTrains/Networks/ALTGVT.py", line 555, in alt_gvt_large
model = ALTGVT(
File "/share/home/wut_pansk/CCTrains/Networks/ALTGVT.py", line 502, in init
super(ALTGVT, self).init(img_size, patch_size, in_chans, num_classes, embed_dims, num_heads,
File "/share/home/wut_pansk/CCTrains/Networks/ALTGVT.py", line 489, in init
super(PCPVT, self).init(img_size, patch_size, in_chans, num_classes, embed_dims, num_heads,
File "/share/home/wut_pansk/CCTrains/Networks/ALTGVT.py", line 423, in init
super(CPVTV2, self).init(img_size, patch_size, in_chans, num_classes, embed_dims, num_heads, mlp_ratios,
File "/share/home/wut_pansk/CCTrains/Networks/ALTGVT.py", line 315, in init
_block = nn.ModuleList([
File "/share/home/wut_pansk/CCTrains/Networks/ALTGVT.py", line 316, in
block_cls(
File "/share/home/wut_pansk/CCTrains/Networks/ALTGVT.py", line 242, in init
super(GroupBlock, self).init(dim, num_heads, mlp_ratio, qkv_bias, drop, attn_drop,
File "/share/home/wut_pansk/.conda/envs/psk/lib/python3.8/site-packages/timm/models/vision_transformer.py", line 260, in init
self.drop_path1 = DropPath(drop_path) if drop_path > 0. else nn.Identity()
TypeError: '>' not supported between instances of 'type' and 'float'

谢谢作者的解答,解决好啦

请问你是把timm包降低版本了还是修改代码了,我也是遇到这个问题了