Giter VIP home page Giter VIP logo

Comments (18)

xiaomingnio avatar xiaomingnio commented on May 21, 2024 1

model, parameters = generate_model(opt)
model = model.cuda()

Add the sentence above.

from real-time-gesrec.

parkjh688 avatar parkjh688 commented on May 21, 2024

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.

ahmetgunduz avatar ahmetgunduz commented on May 21, 2024

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.

parkjh688 avatar parkjh688 commented on May 21, 2024

Yes I have and I checked it again by using that link.

image

from real-time-gesrec.

ahmetgunduz avatar ahmetgunduz commented on May 21, 2024

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.

Karthik-Bhaskar avatar Karthik-Bhaskar commented on May 21, 2024

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.

Screenshot from 2019-08-22 13-22-14

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.

ahmetgunduz avatar ahmetgunduz commented on May 21, 2024

@Karthik-Bhaskar just to check can you please add --no_cuda parameter as well if it is working with cpu.

from real-time-gesrec.

Karthik-Bhaskar avatar Karthik-Bhaskar commented on May 21, 2024

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.

ahmetgunduz avatar ahmetgunduz commented on May 21, 2024

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.

Karthik-Bhaskar avatar Karthik-Bhaskar commented on May 21, 2024

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.

ahmetgunduz avatar ahmetgunduz commented on May 21, 2024

python 3.7.3 and Cuda 10 is the current versions I am using. See below:
Screen Shot 2019-08-31 at 15 56 29

from real-time-gesrec.

ahmetgunduz avatar ahmetgunduz commented on May 21, 2024

Dear @parkjh688 and @Karthik-Bhaskar, did you find any solution for this?

from real-time-gesrec.

parkjh688 avatar parkjh688 commented on May 21, 2024

@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.

ahmetgunduz avatar ahmetgunduz commented on May 21, 2024

@parkjh688 That is great! Looking forward to seeing the outcome...

from real-time-gesrec.

MrXuf avatar MrXuf commented on May 21, 2024

@Karthik-Bhaskar were you able to solve the issue ?
RuntimeError: Error(s) in loading state_dict for ResNeXt
Thanks.

from real-time-gesrec.

ahmetgunduz avatar ahmetgunduz commented on May 21, 2024

the codebase is updated. Could you please pull the repo and recheck ?

from real-time-gesrec.

Karthik-Bhaskar avatar Karthik-Bhaskar commented on May 21, 2024

@MrXuf No, I could not resolve it. Recheck with updated codebase as @ahmetgunduz told above.

from real-time-gesrec.

MrXuf avatar MrXuf commented on May 21, 2024

from real-time-gesrec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.