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 transform.py and other places did not solve my issue.
Any suggestion @jeremy on what should I do next?

thanks


(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: http://wiki.fast.ai/index.php/How_to_ask_for_Help


(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 “libiomp5.so”. 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?


(MTAU) #16

I’ve just worked through this problem as well. Using the current fastai git repo and working in AWS.

have posted a series of blogs on this medium account documenting all my config/setup steps.
hopefully will help a future someone. :slight_smile:


(MTAU) #17

I had the same problem, Deb’s solution worked for me.

Using the current fastai git repo and working in AWS.
my blog below documenting all the steps to get lesson1 working from the current git repo.

have posted a series of blogs on this medium account documenting all my config/setup steps.
hopefully will help a future someone. :slight_smile:


(Pragyat Rana) #18

yeah Deb it works . Thanks


(Pragyat Rana) #19

Thanks Deb it works .


(Kushashwa Ravi Shrimali) #20

I tried https://medium.com/@GuruAtWork/fast-ai-lesson-1-7fc38e978d37 - and am able to import bcolz using ipython but when I do it using jupyter notebook, it does not work.

I’m using a remote server, and using jupyter notebook from the server using

ssh -N -f -L localhost:8888:localhost:PORT username@ip_address

command.

Error:
ImportError: No module named ‘bcolz’