Comments (18)
model, parameters = generate_model(opt)
model = model.cuda()
Add the sentence above.
from real-time-gesrec.
I found the reason of error.
When I print t.device
and self.src_device_obj
in torch data_parallel.py file.
I got cpu for t.device and cuda:0 for self.src_device_obj.
I guess the model made for CPU version. Can you tell me how to change CPU to GPU version?
from real-time-gesrec.
The models are made for GPU actually. Which version of torch are you using? Are you sure that you are using GPU? You can check it as in https://stackoverflow.com/a/48152675/6400484
from real-time-gesrec.
Yes I have and I checked it again by using that link.
from real-time-gesrec.
It seems to be a pytorch bug, Please check this solution https://discuss.pytorch.org/t/bug-in-dataparallel-only-works-if-the-dataset-device-is-cuda-0/28634/18
from real-time-gesrec.
Hi,
@ahmetgunduz Even I am facing the same issue. Is there any solution for this ?
I checked if torch is able to detect the cuda device (1 GPU in my case), It seems good. I am using the torch version 1.2.
I am using the following config just to try out for the offline test on jester.
#!/bin/bash
python offline_test.py \
--root_path ~/ \
--video_path /home/karthik/Desktop/Data/Jester/20bn-jester-v1 \
--annotation_path Desktop/Project/Real-time-GesRec/annotation_Jester/jester.json \
--result_path Desktop/Project/Real-time-GesRec/results \
--resume_path Desktop/Project/Real-time-GesRec/pre-trained-models/jester_resnext_101_RGB_32.pth \
--dataset jester \
--sample_duration 32 \
--learning_rate 0.01 \
--model resnext \
--model_depth 101 \
--batch_size 1 \
--n_classes 27 \
--n_finetune_classes 27 \
--modality RGB \
--n_threads 8 \
--checkpoint 1 \
--train_crop random \
--n_val_samples 1 \
--test_subset val \
--n_epochs 100
@parkjh688 were you able to solve the issue ?
Thanks in advance.
from real-time-gesrec.
@Karthik-Bhaskar just to check can you please add --no_cuda
parameter as well if it is working with cpu.
from real-time-gesrec.
Should I need to add any value for --no_cuda
parameter like True or False.
Or just include without any value like this,
#!/bin/bash
python offline_test.py \
--root_path ~/ \
--video_path /home/karthik/Desktop/Data/Jester/20bn-jester-v1 \
--annotation_path Desktop/Project/Real-time-GesRec/annotation_Jester/jester.json \
--result_path Desktop/Project/Real-time-GesRec/results \
--resume_path Desktop/Project/Real-time-GesRec/pre-trained-models/jester_resnext_101_RGB_32.pth \
--dataset jester \
--sample_duration 32 \
--learning_rate 0.01 \
--model resnext \
--model_depth 101 \
--batch_size 1 \
--n_classes 27 \
--n_finetune_classes 27 \
--modality RGB \
--n_threads 8 \
--checkpoint 1 \
--train_crop random \
--n_val_samples 1 \
--test_subset val \
--n_epochs 100 \
--no_cuda
I tried executing with the above parameters and ran into
RuntimeError: Error(s) in loading state_dict for ResNeXt
Please tell me if it's the wrong way to add that parameter.
Thanks.
from real-time-gesrec.
Everything looks fine actually. The way you gave no_cuda
parameter is right.
Honestly, I have no clue about the error. It may be because of the torch version, the repo is lastly updated for PyTorch 1.0.1.post2 maybe you can downgrade your pytorch version and try.
from real-time-gesrec.
I downgraded the PyTorch to 1.0.1.post2 but the issue remains the same. Can you please let me know if I need to use any particular version of the package or library. Currently, I am using Python 3.6 and Cuda 10.
from real-time-gesrec.
python 3.7.3 and Cuda 10 is the current versions I am using. See below:
from real-time-gesrec.
Dear @parkjh688 and @Karthik-Bhaskar, did you find any solution for this?
from real-time-gesrec.
@ahmetgunduz Unfortunately not yet. I will try to run this code with other machine which has another cuda and cudnn version next week to check this problem whether cuda problem or not.
But I guess this looks like cuda version problem.
from real-time-gesrec.
@parkjh688 That is great! Looking forward to seeing the outcome...
from real-time-gesrec.
@Karthik-Bhaskar were you able to solve the issue ?
RuntimeError: Error(s) in loading state_dict for ResNeXt
Thanks.
from real-time-gesrec.
the codebase is updated. Could you please pull the repo and recheck ?
from real-time-gesrec.
@MrXuf No, I could not resolve it. Recheck with updated codebase as @ahmetgunduz told above.
from real-time-gesrec.
from real-time-gesrec.
Related Issues (20)
- how to run online_test_video.py file with CPU
- Is the label "None" used in the training of classifier? HOT 1
- Thank for your novel work. I have a question: What is the difference between resume_path and pre_trained_path on bash script? THank you so much
- running results
- courses
- How to do the inference with pretrained model?
- bugs in egogesture_online.py line155,in make_dataset
- Prediction accuracy in the nvgesture dataset is poor HOT 4
- Help required to run the code with Egogesture dataset HOT 1
- Similar project which also recognize hand gestures
- Could please update the README?
- when i want to train my own dataset,how to set the sample_duration?
- Training from scratch
- Running a test locally with webcam
- Some questions about the code in nv_online.Py
- about the size of coustom train dataset
- question of the first conv layer parameter
- confusion matrix
- How to use inference.py?
- Beginner in Deep learning
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 real-time-gesrec.