question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

working on google colab

See original GitHub issue

Does the code work on google colab ?

I have this error “KeyError: Caught KeyError in DataLoader worker process 0.” when calling train(segmentation_module, iterator_train, optimizers, history, epoch+1, cfg) after running the command python3 train.py --gpu 1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
xkstevencommented, Jul 8, 2020

train.py needs to be modified as per this issue to run on a single GPU.

to run on a single GPU it’s

train.py --gpu 0 

as opposed to train.py --gpu 1 .

I’ve also uploaded the pretrained models that can be found here

Finally to run the eval_ood.py if using the default config/ade20k-resnet50dilated-ppm_deepsup.yaml and the model I’ve uploaded, change the num_classes parameter in the yaml file to be 13.

Thanks for pointing out the typo. I fixed it and another as well.

I’ve also updated the README as well to reflect these changes

0reactions
julienguegancommented, Jul 8, 2020

Thanks for the update @xksteven . The previous error have disappeared but I think there is still something missing because I can’t make the command python train.py works… I had to add feed_dict = feed_dict[0] in line 32 of models.py because I had a list and not a dictionnary but then I have “Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same”. You can check link_colab if you have time

PS : I also noted one minor error in eval_ood.py : in_scores = - conf[np.logical_not(out_label))] line 51, there is one parenthesis too many

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use Google Colab - GeeksforGeeks
To start working with Colab you first need to log in to your google account, then go to this link https://colab.research.google.com.
Read more >
Google Colab — The Beginner's Guide | by Vishakha Lall
Open Google Drive. Create a new folder for the project. Click on 'New' > 'More' > 'Colaboratory'. Setting GPU Accelerator.
Read more >
Getting Started With Google Colab | by Anne Bonner
A Simple Tutorial for the Frustrated and Confused · Setting up your drive · Game on! · Set up your free GPU ·...
Read more >
How to use Colab | EECS 442: Computer Vision
1. Go to Colab webpage · 2. Upload your .ipynb file · 3. Connect to hosted runtime · 4. Use GPU as an...
Read more >
Google Colaboratory – How to Run Python Code in Your ...
How to Add Colab to Your Google Drive ... 2. Click “more”, then click “connect more apps” at the bottom of that new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found