Problem import modules in ML couse - Lesson 8


Hello, everyone,

I’m taking Jeremy’s ML course, in lesson 8, which talks about neural networks, I get an error when importing from import * or when importing from fastai.torch_imports import *
The error generated is:

ImportError                               Traceback (most recent call last)
<ipython-input-1-c2118a8b5c17> in <module>()
      1 from fastai.imports import *
----> 2 from import *

~\Documents\fastai\courses\ml1\fastai\ in <module>()
      1 from .imports import *
----> 2 from .torch_imports import *
      4 import gzip
      5 from urllib.request import urlretrieve

~\Documents\fastai\courses\ml1\fastai\ in <module>()
      1 import os
----> 2 import torch, torchvision, torchtext
      3 from torch import nn, cuda, backends, FloatTensor, LongTensor, optim
      4 import torch.nn.functional as F
      5 from torch.autograd import Variable

~\Anaconda3\envs\fastai\lib\site-packages\torch\ in <module>()
     74     pass
---> 76 from torch._C import *
     78 __all__ += [name for name in dir(_C)

ImportError: DLL load failed: The specified module could not be found.

reading previous questions, try installing pillow with conda, and installing intel-openmp but it didn’t work.

I have windows 10, I installed the environment following jeremy’s steps. I don’t have a GPU, I only have a CPU (I don’t know if this could be the cause)

(Sumit) #2

Hi @fumpen

I’m also facing the same issue but didn’t try any of the below

Is your issue resolved?


I’m facing exactly same issue on lesson1-vgg.ipynb (windows10, conda env update -f environment-cpu.yml)


Solved with

conda uninstall pytorch
conda install -c peterjc123 pytorch-cpu

I faced this problem because I initially installed pytorch, which seems to have problems with cpu only machines.