mlpc-ucsd / TESTR

(CVPR 2022) Text Spotting Transformers
Apache License 2.0
179 stars 22 forks source link

Not compiled with GPU support #21

Closed k-styles closed 1 year ago

k-styles commented 1 year ago

Hi, I am getting the following error while running TESTR on custom dataset:

[03/19 10:35:49 adet.trainer]: Starting training from iteration 0
/home/kartik.anand.19031/.conda/envs/testr/lib/python3.8/site-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at  /opt/conda/conda-bld/pytorch_1639180588308/work/aten/src/ATen/native/TensorShape.cpp:2157.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
Traceback (most recent call last):
  File "tools/train_net.py", line 289, in <module>
    launch(
  File "/home/kartik.anand.19031/.conda/envs/testr/lib/python3.8/site-packages/detectron2/engine/launch.py", line 82, in launch
    main_func(*args)
  File "tools/train_net.py", line 283, in main
    return trainer.train()
  File "tools/train_net.py", line 104, in train
    self.train_loop(self.start_iter, self.max_iter)
  File "tools/train_net.py", line 93, in train_loop
    self.run_step()
  File "/home/kartik.anand.19031/.conda/envs/testr/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 494, in run_step
    self._trainer.run_step()
  File "/home/kartik.anand.19031/.conda/envs/testr/lib/python3.8/site-packages/detectron2/engine/train_loop.py", line 273, in run_step
    loss_dict = self.model(data)
  File "/home/kartik.anand.19031/.conda/envs/testr/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/kartik.anand.19031/text_spotting/testr/TESTR/adet/modeling/transformer_detector.py", line 181, in forward
    output = self.testr(images)
  File "/home/kartik.anand.19031/.conda/envs/testr/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/kartik.anand.19031/text_spotting/testr/TESTR/adet/modeling/testr/models.py", line 181, in forward
    hs, hs_text, init_reference, inter_references, enc_outputs_class, enc_outputs_coord_unact = self.transformer(
  File "/home/kartik.anand.19031/.conda/envs/testr/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/kartik.anand.19031/text_spotting/testr/TESTR/adet/layers/deformable_transformer.py", line 148, in forward
    memory = self.encoder(src_flatten, spatial_shapes, level_start_index, valid_ratios, lvl_pos_embed_flatten, mask_flatten)
  File "/home/kartik.anand.19031/.conda/envs/testr/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/kartik.anand.19031/text_spotting/testr/TESTR/adet/layers/deformable_transformer.py", line 246, in forward
    output = layer(output, pos, reference_points, spatial_shapes, level_start_index, padding_mask)
  File "/home/kartik.anand.19031/.conda/envs/testr/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/kartik.anand.19031/text_spotting/testr/TESTR/adet/layers/deformable_transformer.py", line 211, in forward
    src2 = self.self_attn(self.with_pos_embed(src, pos), reference_points, src, spatial_shapes, level_start_index, padding_mask)
  File "/home/kartik.anand.19031/.conda/envs/testr/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/kartik.anand.19031/text_spotting/testr/TESTR/adet/layers/ms_deform_attn.py", line 150, in forward
    output = _MSDeformAttnFunction.apply(
  File "/home/kartik.anand.19031/text_spotting/testr/TESTR/adet/layers/ms_deform_attn.py", line 23, in forward
    output = _C.ms_deform_attn_forward(
RuntimeError: Not compiled with GPU support

I am aware that it's a Adelaidet build issue, but in my conda environment torch.cuda.is_available() outputs True. Not quite sure what might be going wrong. It would be great if someone could help me out here!