-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
RuntimeError: Ninja is required to load C++ extensions #1454
Comments
What about direct build by the following code: from yolox.layers import FastCOCOEvalOp
FastCOCOEvalOp().jit_load() |
Where should the above code be added? Before this problem occurs, I have added the above two lines of code to |
Plz try it in a terminal like |
When i try it in a terminal like
|
Plz make sure that ninja is installed in your conda env. |
I am add this code in train.py, and get the following err:
I have the same problem, but the ninja was installed in my conda env @yjcreation Then I solved it by following code: wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
sudo unzip ninja-linux.zip -d /usr/local/bin/
sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 --force
|
Is there any solution in windows environment with this problem? |
What solved it for me (so far) in a windows environment:
After that had to fix #1346 and now I am currently fixing #1307. UPDATE: |
run code by
python tools/eval.py -n yolox-s -c yolox_s.pth -b 2 -d 1 --conf 0.001
error:
2022-07-30 00:16:44.546 | ERROR | yolox.core.launch:launch:98 - An error has been caught in function 'launch', process 'MainProcess' (73156), thread 'MainThread' (85696):
Traceback (most recent call last):
File "tools/eval.py", line 219, in
args=(exp, args, num_gpu),
│ │ └ 1
│ └ Namespace(batch_size=2, ckpt='yolox_s.pth', conf=0.001, devices=1, dist_backend='nccl', dist_url=None, exp_file=None, experim...
└ ╒═══════════════════╤════════════════════════════════════════════════════════════════════════════════════════════════════════...
File "tools/eval.py", line 194, in main
model, is_distributed, args.fp16, trt_file, decoder, exp.test_size
│ │ │ │ │ │ │ └ (640, 640)
│ │ │ │ │ │ └ ╒═══════════════════╤════════════════════════════════════════════════════════════════════════════════════════════════════════...
│ │ │ │ │ └ None
│ │ │ │ └ None
│ │ │ └ False
│ │ └ Namespace(batch_size=2, ckpt='yolox_s.pth', conf=0.001, devices=1, dist_backend='nccl', dist_url=None, exp_file=None, experim...
│ └ False
└ YOLOX(
(backbone): YOLOPAFPN(
(backbone): CSPDarknet(
(stem): Focus(
(conv): BaseConv(
(conv): ...
File "d:\pywork\3.debug\yolox\yolox\evaluators\coco_evaluator.py", line 242, in evaluate
eval_results = self.evaluate_prediction(data_list, statistics)
│ │ │ └ tensor([2.1702, 0.0110, 4.0000], device='cuda:0')
│ │ └ [{'image_id': 0, 'category_id': 56, 'bbox': [-33.6690673828125, 9.699737548828125, 3907.0078125, 2132.7041015625], 'score': 0...
│ └ <function COCOEvaluator.evaluate_prediction at 0x0000023B58CC9BF8>
└ <yolox.evaluators.coco_evaluator.COCOEvaluator object at 0x0000023B60FC6F28>
File "d:\pywork\3.debug\yolox\yolox\evaluators\coco_evaluator.py", line 317, in evaluate_prediction
from yolox.layers import COCOeval_opt as COCOeval
File "d:\pywork\3.debug\yolox\yolox\layers_init_.py", line 11, in
from .fast_coco_eval_api import COCOeval_opt
File "d:\pywork\3.debug\yolox\yolox\layers\fast_coco_eval_api.py", line 17, in
FastCOCOEvalOp().jit_load()
└ <class 'yolox.layers.jit_ops.FastCOCOEvalOp'>
File "d:\pywork\3.debug\yolox\yolox\layers\jit_ops.py", line 107, in jit_load
verbose=verbose,
└ True
File "D:\F\Anaconda3\envs\yolox\lib\site-packages\torch\utils\cpp_extension.py", line 1136, in load
keep_intermediates=keep_intermediates)
└ True
File "D:\F\Anaconda3\envs\yolox\lib\site-packages\torch\utils\cpp_extension.py", line 1347, in _jit_compile
is_standalone=is_standalone)
└ False
File "D:\F\Anaconda3\envs\yolox\lib\site-packages\torch\utils\cpp_extension.py", line 1418, in _write_ninja_file_and_build_library
verify_ninja_availability()
└ <function verify_ninja_availability at 0x0000023B632F7268>
File "D:\F\Anaconda3\envs\yolox\lib\site-packages\torch\utils\cpp_extension.py", line 1474, in verify_ninja_availability
raise RuntimeError("Ninja is required to load C++ extensions")
RuntimeError: Ninja is required to load C++ extensions
How can I solve this on a windows machine ?
When i use
pip install ninja
, it shows Requirement already satisfied: ninja in d:\f\anaconda3\envs\yolox\lib\site-packages (1.10.2.3)The text was updated successfully, but these errors were encountered: