Munmap_chunk(): invalid pointer

I can successfully run yolov5 python detect.py to carry out the test.

However, whenever I created another file, say, myfile.py , and trying to packed it into a class , device = select_device(opt.device) will fail with this ERROR message: munmap_chunk(): invalid pointer .

Please help…

Problem found…
It looks my PyTorch is NOT successfully built against CUDA ? hmmmmm…