Skip to content

CPU evaluation #1464

Open
Open
@Sidd1609

Description

@Sidd1609

I am trying to evaluate the models provided in the repo on the COCO dataset using the tools/eval.py and switched model.load to device='cpu'

But there are some functions in "coco_evaluator.py" that use cuda, is there any way that I can evaluate the model on a CPU only machine?

This is the error that I am getting

2022-08-04 23:05:34 | ERROR | yolox.core.launch:98 - An error has been caught in function 'launch', process 'MainProcess' (50200), thread 'MainThread' (4461495808):
Traceback (most recent call last):

File "tools/eval.py", line 214, in
launch(
└ <function launch at 0x7f789b6f1550>

File "/Users/srisiddarthchakaravarthy/Desktop/SID/GSOC_22/Work/Models/YOLOX/YOLOX_main/tools/yolox/core/launch.py", line 98, in launch
main_func(*args)
│ └ (╒═══════════════════╤══════════════════════════════════════════════════════════════════════════════════════════════╕
│ │ keys ...
└ <function main at 0x7f789c54d5e0>

File "tools/eval.py", line 195, in main
*_, summary = evaluator.evaluate(
│ └ <function COCOEvaluator.evaluate at 0x7f789d1e9670>
└ <yolox.evaluators.coco_evaluator.COCOEvaluator object at 0x7f789d218fa0>

File "/Users/srisiddarthchakaravarthy/Desktop/SID/GSOC_22/Work/Models/YOLOX/YOLOX_main/tools/yolox/evaluators/coco_evaluator.py", line 162, in evaluate
imgs = imgs.type(tensor_type)
│ │ └ <class 'torch.cuda.HalfTensor'>
│ └ <method 'type' of 'torch._C._TensorBase' objects>
└ tensor([[[[ 77., 64., 57., ..., 14., 12., 15.],
[ 68., 73., 52., ..., 13., 10., 9.],
[ 68., ...

RuntimeError: Cannot initialize CUDA without ATen_cuda library. PyTorch splits its backend into two shared libraries: a CPU library and a CUDA library; this error has occurred because you are trying to use some CUDA functionality, but the CUDA library has not been loaded by the dynamic linker for some reason. The CUDA library MUST be loaded, EVEN IF you don't directly use any symbols from the CUDA library! One common culprit is a lack of -Wl,--no-as-needed in your link arguments; many dynamic linkers will delete dynamic library dependencies if you don't depend on any of their symbols. You can check if this has occurred by using ldd on your binary to see if there is a dependency on *_cuda.so library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions