Comments (8)
@lanteng77 You mean train or test?
If test, modify the line from 'cuda:0' to 'cpu'
predictor = Predictor(cfg, args.model, logger, device='cuda:0')
from nanodet.
I don't have a GPU, so training needs to be modified.
from nanodet.
I don't have a GPU, so training needs to be modified.
Sorry, nanodet current not support cpu training. You can try to change all .to('cuda') to .to('cpu') in this project. But I can't make sure that it will work. Just have a try.
from nanodet.
thk, this is very useful for me. I will try.
from nanodet.
(nanodet) gu@local:/home/marchinelearning/nanodet$ python demo/demo.py image --config config/nanodet-m.yml --model model/nanodet_m.pth --path input/1.jpg
model size is 1.0x
init weights...
=> loading pretrained model https://download.pytorch.org/models/shufflenetv2_x1-5666bf0f80.pth
Finish initialize Lite GFL Head.
[root][11-25 22:09:37]INFO:Press "Esc", "q" or "Q" to exit.
Traceback (most recent call last):
File "demo/demo.py", line 107, in <module>
main()
File "demo/demo.py", line 90, in main
meta, res = predictor.inference(image_name)
File "demo/demo.py", line 53, in inference
results = self.model.inference(meta)
File "/home/marchinelearning/nanodet/nanodet/model/arch/one_stage.py", line 34, in inference
torch.cuda.synchronize()
File "/home/gu/anaconda3/envs/nanodet/lib/python3.8/site-packages/torch/cuda/__init__.py", line 378, in synchronize
_lazy_init()
File "/home/gu/anaconda3/envs/nanodet/lib/python3.8/site-packages/torch/cuda/__init__.py", line 166, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
i have modified the line from 'cuda:0' to 'cpu'
predictor = Predictor(cfg, args.model, logger, device='cuda:0') => predictor = Predictor(cfg, args.model, logger, device='cpu'),
but still throw an exception.
from nanodet.
(nanodet) gu@local:/home/marchinelearning/nanodet$ python demo/demo.py image --config config/nanodet-m.yml --model model/nanodet_m.pth --path input/1.jpg model size is 1.0x init weights... => loading pretrained model https://download.pytorch.org/models/shufflenetv2_x1-5666bf0f80.pth Finish initialize Lite GFL Head. [root][11-25 22:09:37]INFO:Press "Esc", "q" or "Q" to exit. Traceback (most recent call last): File "demo/demo.py", line 107, in <module> main() File "demo/demo.py", line 90, in main meta, res = predictor.inference(image_name) File "demo/demo.py", line 53, in inference results = self.model.inference(meta) File "/home/marchinelearning/nanodet/nanodet/model/arch/one_stage.py", line 34, in inference torch.cuda.synchronize() File "/home/gu/anaconda3/envs/nanodet/lib/python3.8/site-packages/torch/cuda/__init__.py", line 378, in synchronize _lazy_init() File "/home/gu/anaconda3/envs/nanodet/lib/python3.8/site-packages/torch/cuda/__init__.py", line 166, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled
i have modified the line from 'cuda:0' to 'cpu'
predictor = Predictor(cfg, args.model, logger, device='cuda:0') => predictor = Predictor(cfg, args.model, logger, device='cpu'),
but still throw an exception.
Try to comment out all torch.cuda.synchronize()
.
from nanodet.
still the issue is same @RangiLyu
i tried these things
1)Try to comment out all torch.cuda.synchronize()
2) have modified the line from 'cuda:0' to 'cpu'
3) changed all .to('cuda') to .to('cpu')
still facing this same issue
File "/home/marchinelearning/nanodet/nanodet/model/arch/one_stage.py", line 34, in inference
torch.cuda.synchronize()
File "/home/gu/anaconda3/envs/nanodet/lib/python3.8/site-packages/torch/cuda/init.py", line 378, in synchronize
_lazy_init()
File "/home/gu/anaconda3/envs/nanodet/lib/python3.8/site-packages/torch/cuda/init.py", line 166, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
is there any alternative for this code to run on CPU?
from nanodet.
@siva-wellnesys There is still a torch.cuda.synchronize()
you didn't comment out, this issue should be solved by above discussion.
from nanodet.
Related Issues (20)
- Why the training phase is quite slow with V100 GPU? HOT 5
- namodet config file nanodet.plus-0.5x.yml pipeline value
- concerning the auxiliary training module
- How to train model with MobileNetV2?
- How to add MobileNetV3 backbone?
- 训练问题
- Maybe there is some wrong code comments?
- How to apply MobileViTV2 using Timm?
- 为什么显存占用这么高Why is the memory usage so high
- Traning code freezed when saving best check point
- Why did this error occur during verification?
- How to change the backbone to CSPDarkNet53?
- > 我在训练时也遇到了同样的问题,但是我的gpu并没有占用,您知道该怎么解决吗 TimeoutError: The client socket has timed out after 1800s while trying to connect to (127.0.0.1, 53580).
- input image size
- Error Training NanoDet-Plus with COCO Subset, PyTorch Lightning
- raspberry zero w 2
- OSError: /usr/local/lib/python3.8/dist-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZNK3c107SymBool10guard_boolEPKcl HOT 1
- Batch inferencing in nanodet
- why the learning rate recored by log is different from that recorded by tensorboard?
- train in multi gpus in ddp
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nanodet.