Anyone able to run the Lesson 1 notebook?

Hi, I was using python 3.5 on Ubuntu machine but because of code formatting in ipython notebooks I installed anaconda with python3.6. Now I cant install few python packages (isoweek, pandas_summary, torchtext) from conda.

Command:

conda install isoweek

prints the following:

Fetching package metadata ...........

PackageNotFoundError: Packages missing in current channels:
            
  - isoweek

We have searched for the packages in the following channels:
            
  - https://repo.continuum.io/pkgs/main/linux-64
  - https://repo.continuum.io/pkgs/main/noarch
  - https://repo.continuum.io/pkgs/free/linux-64
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/linux-64
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/linux-64
  - https://repo.continuum.io/pkgs/pro/noarch

I have found alternative channels for isoweek on the internet: ‘auto’. But when I type :

conda install -c auto isoweek

I got this:

Fetching package metadata .............
Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict:
  - isoweek -> python 2.7*
  - python 3.6*
Use "conda info <package>" to see the dependencies for each package.

Have you had the same problem?

I got it running using by creating fastai environment from environment.yml file

1 Like

Do pip install on those. Some packages are not available on conda repository.

First install anaconda 5.0.1 (latest version) that comes bundled with python 3.6
then install each of the following:

  • pip install isoweek
  • pip install pandas_summary
  • pip install torch text
  • conda install pytorch torchvision cuda80 -c soumith
  • conda install -c menpo opencv3

I used an AWS Deep Learning instance p2.xlarge instance which comes with python 3.5 pre-installed. When I used pip3 install …, what I didn’t realise was that it used the default version of python which is 3.5 and that’s why you have to use pip install…

(when you use conda install, make sure you are in the conda environment)

2 Likes

I get this error too, when i increase the batch size for the training of the last layer, but I had to reduce it to train the whole network…

correct me if I’m wrong. conda install and pip install put new python packages in different directories, no? For instance, if I pip install package, it will live in standard python folder (/usr/…/python3.6/…/site-packages). Conda will not see this change since it looks for packages only in its directories (~/anaconda3/ … / site-packages)

Depends where your pip is coming from. You can do “which pip” to verify that its coming from the anadconda tree.

You should prefer to install using conda
But if a package is not available through conda distribution but is available through pip then its fine to install it with pip as long as you are using the pip that is in your anaconda install tree.

No, they should both go to the same folder, assuming that the pip in your path is coming from anaconda.

Hello everyone,
Does anyone had the following error while trying to setup a tunnel connection to an aws instance?
“channel 3: open failed: connect failed: Connection refused”.
I am able to remote to the aws and was able to clone the git repository of get the data from the course 1.
But a tunneling doesn’t work.
I am on win10 and leveraging an ubuntu.
Thanks

i had

@ecdrid where you able to fix it ?

Thanks.

Does anyone had the following issue with Pytorch ?
I tried reinstalling it on my instance but still getting the same issues.

Traceback (most recent call last):

File “/usr/local/lib/python3.5/dist-packages/IPython/core/interactiveshell.py”, line 2910, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

File “”, line 1, in
from fastai.transforms import *

File “/home/ubuntu/fastai/courses/dl1/fastai/transforms.py”, line 2, in
from .layer_optimizer import *

File “/home/ubuntu/fastai/courses/dl1/fastai/layer_optimizer.py”, line 2, in
from .torch_imports import *

File “/home/ubuntu/fastai/courses/dl1/fastai/torch_imports.py”, line 26
if pre: load_model(m, f’{path}/weights/{fn}.pth’)
^
SyntaxError: invalid syntax
Thanks

You are running Python 3.5. You should install 3.6.

2 Likes

Could anyone try to run the very first lesson1 notebook with latest git pull fastai
and see if it works till “plot_confusion_matrix(cm, data.classes)”?

I started to get empty graphs on: learn.sched.plot_lr()

And on:

sklearn.metrics import confusion_matrix
cm = confusion_matrix(y, preds)

~/anaconda3/envs/fastai/lib/python3.6/site-packages/sklearn/utils/validation.py in check_consistent_length(*arrays)
202 if len(uniques) > 1:
203 raise ValueError(“Found input variables with inconsistent numbers of”
–> 204 " samples: %r" % [int(l) for l in lengths])
205
206

ValueError: Found input variables with inconsistent numbers of samples: [2000, 5]

On fastai repo from Nov 22 - all works fine.

1 Like

Thanks for being 18h ahead of me, good sanity check. I’m having the same issues. I’m running Windows + GPU. What environment are you running? Good news is Windows + GPU is now working – at least as well as your system.

  1. Empty graphs (2) starting from Improve Your Graph onwards: learn.sched.plot_lr()
  2. ValueError: Found input variables with inconsistent numbers of samples: [2000, 5]
  3. Many errors (albeit innocuous): “Failed to display Jupyter Widget of type HBox.”

ValueError Traceback (most recent call last)
in ()
1 from sklearn.metrics import confusion_matrix
----> 2 cm = confusion_matrix(y, preds)

~\Anaconda3\lib\site-packages\sklearn\metrics\classification.py in confusion_matrix(y_true, y_pred, labels, sample_weight)
248
249 “”"
–> 250 y_type, y_true, y_pred = _check_targets(y_true, y_pred)
251 if y_type not in (“binary”, “multiclass”):
252 raise ValueError("%s is not supported" % y_type)

~\Anaconda3\lib\site-packages\sklearn\metrics\classification.py in _check_targets(y_true, y_pred)
69 y_pred : array or indicator matrix
70 “”"
—> 71 check_consistent_length(y_true, y_pred)
72 type_true = type_of_target(y_true)
73 type_pred = type_of_target(y_pred)

~\Anaconda3\lib\site-packages\sklearn\utils\validation.py in check_consistent_length(*arrays)
202 if len(uniques) > 1:
203 raise ValueError(“Found input variables with inconsistent numbers of”
–> 204 " samples: %r" % [int(l) for l in lengths])
205
206

ValueError: Found input variables with inconsistent numbers of samples: [2000, 5]

1 Like

I’m getting the same error.

Sounds like the recent updates to TTA - search this forum for details.

The latest github source code fixes all the issues I’ve hit. Lesson1 runs to completion without any errors.