Developer chat

(Vu Ha) #844

I updated from 1.0.43.post1 to 1.0.47 and the ImageDataBunch creation for object detection is now much much faster, specifically the call to label_from_func which took 10s of seconds and now is instantaneous. I’m curious which change was responsible for this speedup. Great job!!


There was a bug where we were loading all the targets at creation, which required opening all the images to get their sizes. Fixed it and we’re back to things being loaded on the fly when needed, that’s why it’s now faster!


No reason, you can add it in the init.

(Stas Bekman) #847

fyi, fastai-1.0.47-post1 has been released with all the hot fixes backported since 1.0.47 release till now.

List of fixes:

(Vu Ha) #848

fit_one_cycle seems to be broken in 1.0.47. Using Lesson #9’s SSD model, I have two modes of training:, lr=0.004)
fit_one_cycle(ssd.learn, cyc_len=30, max_lr=0.004)

The first one runs fine, but the second on with fit_one_cycle hangs during the metric callback. Also it takes about 6x time to finish the validation loss computation.

I’ll take a look later but just wanted to mention this in case someone has a hint what may be happening here.

(Stas Bekman) #849

Thanks for the report, @vha14

This is always a great opportunity to add a new test that fails, since our current test suite has no problems.

Since the callbacks were revamped it’s possible that some weren’t ported correctly. So having a test that fails makes it much easier to identify and fix the problem and avoid causing it again in the future.

Thank you.

And using our newly released test regisry, - click on [test], gives you:

Tests found for fit_one_cycle :

  • pytest -sv tests/ [source]
  • pytest -sv tests/ [source]

so that you have it if you need to find a starting point to build upon.

(Butch Landingin ) #850

Hi @stas,
One of the changes in version 1.0.47-post1 has been the removal of create_cnn
and its replacement by create_cnn_model in the list of exported methods (see
this commit) which doesn’t seem to match it in usage, and might not be needed as its replacement method cnn_learner has already been previously incorporated.

This also broke a lot of the existing notebooks and documentation including the videos (since they all refer to create_cnn) so I might suggest adding it back to the list of exported methods with the current deprecation to allow for a smoother transition?

Best regards,

Getting error while deploying lesson 2 bear classification to google app engine
(Robert Bracco) #851

Hey guys, I would like to make a PR for a simple bug fix but I am stuck following this guide… - How to make a pull request

When I call make test in step 5, I get the following error:

E /bin/sh: 1: /usr/local/cuda/bin/nvcc: not found

The full error message is listed below. Also if I try to import fastai in my notebooks it no longer works. I’m guessing this is because I uninstalled fastai in the previous step but haven’t finished replacing it with my own branch. Please help if you can. Thanks.

``make test
python --quiet test
warning: no previously-included files matching ‘pycache’ found under directory ‘*’
warning: no files found matching ‘’ under directory ‘docs’
warning: no files found matching ‘Makefile’ under directory ‘docs’
warning: no files found matching ‘make.bat’ under directory ‘docs’
============================= test session starts ==============================
platform linux – Python 3.6.8, pytest-4.3.0, py-1.8.0, pluggy-0.9.0
rootdir: /notebooks/fastai-fork, inifile: setup.cfg
plugins: xdist-1.26.1, forked-1.0.2
collected 256 items / 1 errors / 255 selected

==================================== ERRORS ====================================
___________________ ERROR collecting tests/ ___________________
/opt/conda/envs/fastai/lib/python3.6/site-packages/torch/utils/ in _build_extension_module
/opt/conda/envs/fastai/lib/python3.6/ in run
output=stdout, stderr=stderr)
E subprocess.CalledProcessError: Command ‘[‘ninja’, ‘-v’]’ returned non-zero exit status 1.

During handling of the above exception, another exception occurred:
tests/ in
from fastai.text.models import qrnn
fastai/text/models/ in
forget_mult_cuda = load(name=‘forget_mult_cuda’, sources=[fastai_path/f for f in files])
/opt/conda/envs/fastai/lib/python3.6/site-packages/torch/utils/ in load
/opt/conda/envs/fastai/lib/python3.6/site-packages/torch/utils/ in jit_compile
/opt/conda/envs/fastai/lib/python3.6/site-packages/torch/utils/ in write_ninja_file_and_build
build_extension_module(name, build_directory, verbose)
/opt/conda/envs/fastai/lib/python3.6/site-packages/torch/utils/ in build_extension_module
raise RuntimeError(message)
E RuntimeError: Error building extension ‘forget_mult_cuda’: [1/2] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=forget_mult_cuda -DTORCH_API_INCLUDE_EXTENSION_H -isystem /opt/conda/envs/fastai/lib/python3.6/site-packages/torch/lib/include -isystem /opt/conda/envs/fastai/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /opt/conda/envs/fastai/lib/python3.6/site-packages/torch/lib/include/TH -isystem /opt/conda/envs/fastai/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /opt/conda/envs/fastai/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF2_OPERATORS__ --compiler-options ‘-fPIC’ -std=c++11 -c /notebooks/fastai-fork/fastai/text/models/ -o forget_mult_cuda_kernel.cuda.o
E FAILED: forget_mult_cuda_kernel.cuda.o
E /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=forget_mult_cuda -DTORCH_API_INCLUDE_EXTENSION_H -isystem /opt/conda/envs/fastai/lib/python3.6/site-packages/torch/lib/include -isystem /opt/conda/envs/fastai/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /opt/conda/envs/fastai/lib/python3.6/site-packages/torch/lib/include/TH -isystem /opt/conda/envs/fastai/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /opt/conda/envs/fastai/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options ‘-fPIC’ -std=c++11 -c /notebooks/fastai-fork/fastai/text/models/ -o forget_mult_cuda_kernel.cuda.o
E /bin/sh: 1: /usr/local/cuda/bin/nvcc: not found
E ninja: build stopped: subcommand failed.
!!! Interrupted: 1 errors during collection !!!
=========================== 1 error in 4.21 seconds ============================
Makefile:169: recipe for target ‘test’ failed
make: *** [test] Error 2``

(benedikt herudek) #852

anyone solved the error in recent version when running tests?

Exception: Error: libsixel is needed. See

Issue logged here:

wondering if there is a simple pip install to work around it until fixed


(benedikt herudek) #853

you ran this command after pulling down the code?

and make an editable install with the developer prerequisites:

pip install -e ".[dev]"

Note, in the latest release, on testing there is an error - see my post above

(Konstantin Dorichev) #854

I have got the same error.
Yes, using editable install and the latest code.
Error pops up when importing from fastai.tabular import *

Exception                                 Traceback (most recent call last)
<ipython-input-1-e6990e2f588f> in <module>
----> 1 from fastai.tabular import *
      2 from fastai.callbacks import ReduceLROnPlateauCallback,EarlyStoppingCallback
      3 from sklearn.metrics import roc_auc_score

~/fastai-fork/fastai/tabular/ in <module>
----> 1 from .. import basics
      2 from ..basics import *
      3 from .data import *
      4 from .transform import *
      5 from .models import *

~/fastai-fork/fastai/ in <module>
----> 1 from .basic_train import *
      2 from .callback import *
      3 from .core import *
      4 from .basic_data import *
      5 from .data_block import *

~/fastai-fork/fastai/ in <module>
      8 from fastprogress.fastprogress import format_time, IN_NOTEBOOK
      9 from time import time
---> 10 from fastai.sixel import plot_sixel
     12 __all__ = ['Learner', 'LearnerCallback', 'Recorder', 'RecordOnCPU', 'fit', 'loss_batch', 'train_epoch', 'validate',

~/fastai-fork/fastai/ in <module>
      3 libsixel = try_import('libsixel')
      4 if not libsixel:
----> 5     raise Exception('Error: `libsixel` is needed. See')
      7 def _sixel_encode(data, width, height):

Exception: Error: `libsixel` is needed. See

(benedikt herudek) #855

I think I know who added the line :wink:

from fastai.sixel import plot_sixel

github has this nice blame function :wink:

(Konstantin Dorichev) #856

libsixel was introduced by @jeremy in this commit.

(benedikt herudek) #857

any pip installs found to work around it locally?

Think eventually its gonna go somewhere to the dependencies (maybe called by pip install -e “.[dev]”)

(Konstantin Dorichev) #859

FIX: The error disapeared after I’ve installed libsixel-python using pip.

(benedikt herudek) #860

tried that, doesnt work in my case here locally

(Konstantin Dorichev) #861

Did you manage to install libsixel-python?
Show me your error.

(benedikt herudek) #862

install is fine, error stays the same. no worries, can work around it :wink:

(George Zhang) #863

Hey @Benudek, I just downgraded my local setup to the previous release. The package seems well maintained in Ubuntu but the brew maintenance has stopped years ago. I am personally using a Mac so my only option for now is to download the source files and compile them myself.

(George Zhang) #864

I can confirm you that installing the package above did not solve my problem, either.