Import error in Lesson 1

(Kumar Shridhar) #1

Hello everyone,

I am importing several libraries in lesson 1 cell:

And I am getting the following error:

I checked the following link to reduce the amount of TLS in PyTorch:

But adding import cv2, torch in and other places did not solve my issue.
Any suggestion @jeremy on what should I do next?


(Jeremy Howard) #2

I suspect a git pull may fix this - may also need to reboot.

(Kumar Shridhar) #3

I did git pull but no luck.
I made it work. Downgrading PyTorch to version 0.1.12 from 0.2.0 solved the issue for now.

Thanks Jeremy.

(Sid Ravinutala) #4

I had the same error and this was helpful.
@jeremy - Is using the older version fine or is there a better fix for this?

(Jeremy Howard) #5

@sidravi1 I’d need to know more about your setup. Here’s some tips:

(Sid Ravinutala) #6

Apologies. Here are my details:

  1. Using paperspace fastai image from week 1
  2. All was good until I did a git pull this morning. It gave me an error about missing packages. I installed those and did a conda update to bring everything up to date.
  3. Got error that it couldn’t find “”. After some googling, I updated my LD_LIBRARY_PATH in to add the path to this lib.
  4. Started getting the ‘dlopen’ error above in the same line as Kumar: “from torch._C import *”. Tried restarting the machine but no love.
  5. Reverted PyTorch version back to 0.1.12 (and any other dependencies that conda found)
  6. Works

(Jeremy Howard) #7

Yeah things aren’t working right on Paperspace at the moment. @dillon is investigating!

Lesson 1 In-Class Discussion
(Jeremy Howard) #8

I wonder if it’s pillow-simd. Try conda update pillow.

(Sid Ravinutala) #9

pillow is up to date (v3.4.2).
I’m happy to wait for @dillon to finish investigating. In the meantime I’ll use pytorch 0.1.12 - so far it seems to run fine.
Thanks for your help.

(Dillon) #10

I’m debugging over in this thread: [Adv] Significant changes to fastai just pushed

Can you see if those steps reproduce the issue for you?

Lesson 1 In-Class Discussion
(Debashish Panigrahi) #11

got the same error when I was trying to run in paperspace. You are probably very close :slight_smile:

before any other import insert to your notebook

import torch, cv2

(I’ve been using my notebooks in paperspace in this mode for past 1 week. Please makesure to RESTART your kernel.)

(Sid Ravinutala) #12

Ok. Will try and get back to you.

(Sid Ravinutala) #13

Sorry mate. I finally tried it and it didn’t work.

I get the “ImportError: dlopen: cannot load any more object with static TLS”

(Sid Ravinutala) #14

Yes! It works.

Just needed to restart kernel (oops) and your fix works. Thanks!

(Ankit Patro) #15

Hey @JupyterAI,
How did you change the PyTorch version from 0.1.12 to 0.2.0?