Platform: Colab ✅

Hi Matt-le-kat Mantis
!curl -s https://course.fast.ai/setup/colab | bash

I tried colab today and it was fine!

Cheers mrfabulous1 :smiley::smiley:

1 Like

Hi mrfabulous1,
I am still encountering the same problem about not being able to import any libraries from fastai package due to version conflicts, after executing
!curl -s https://course.fast.ai/setup/colab | bash
and updating fastai,
but everything seems to work fine when i simply don’t execute the command and don’t update anything
hope this gets addressed soon as it may cause some inconvenience in the future
Thanks for looking into this by the way

Hi Mantis hope you are well I ran your code below 10 mins ago and it
worked fine.
from fastai.vision import *
import pandas as pd
import numpy as np
import imutils
import glob
import cv2
import shutil
from tqdm import tqdm_notebook, tqdm
import matplotlib.pyplot as plt
pd.set_option(‘display.max_columns’, 500)

!curl -s https://course.fast.ai/setup/colab | bash

Everything worked fine. I also noticed in your error above that it is referring to fastprogress 0.1.22 the version being downloaded on colab is 0.2.1 also.

Maybe creating a new notebook and starting again may help?

Also the latest release of fastprogress was Dec 28, 2019 and is now 0.2.1

Cheers mrfabulous1 :smiley::smiley: and a happy new year :christmas_tree::christmas_tree::christmas_tree::christmas_tree::christmas_tree:

2 Likes

Thank you so much for spending your precious time and looking into this
As i said the issue is solved and not really bothering me

i just wanted that this gets noticed as many newcomers doing things accordingly may encounter a problem

In your case everything worked fine because you executed
!curl -s https://course.fast.ai/setup/colab | bash
before importing stuff

to recreate this you will have to update the fastai first and then importing libraries

As you said that the latest release of fastprogress was on Dec 28, 2019, it was the same day that i started getting this error


As the course guide for colab states that the line should be executed first, many newcomers following that guide may encounter problems

creating a new notebook and starting again is still going to be a problem if we update fastai (according to the guide) first

still don’t look to much into it, as the simply not executing cell solves the issue
Happy new year to you too man :grinning:

1 Like

It seems to take hours to finish a learn.fit_one_cycle call. Can I save the training status in the middle and resume the training in case my colab session were disconnected before it is done?

1 Like

Hi jerron hope you are well!

These links may help


https://docs.fast.ai/callbacks.html#SaveModelCallback

Cheers mrfabulous1 :smiley::smiley:

1 Like

Hey @Mantis, I was also facing the same issue and it’ll persist till the next release. However, it seems like the issue is fixed in fastai-1.0.61.dev0 and you can install the same to tackle this problem as of now. To do so,

  1. (optionally) !curl -s https://course.fast.ai/setup/colab | bash
    (Since this script does some environment setup for you which you might need to do by yourself.)
  2. !pip uninstall fastai fastprogress
  3. !pip install git+https://github.com/fastai/fastai.git
  4. Restart the runtime for once. (not reset)

and you’re good to go. You can check current fastai version by executing

from fastai.vision import *
print(__version__)

In the last days I’ve been experiencing a lot of issues with Colab - not related to fastai or any particular library, but in general cells take a lot of time to run, often get hung up, I need to restart or reconnect the kernels many times to get something done. Is it only my experience, or have other people noted this as well?

I’ve noticed the hanging a few times. But Maybe once. Do you have Pro or the free version @darek.kleczek?

I’m using free version - is it better with Pro?

I got pro and I can’t complain. I’ve had mabye one instance where I had a local hang up/crash of some form but otherwise smooth as butter.

I wanted to ask one thing I am new to colab and was getting error in importing text_classification
import torch
import torchtext
from torchtext.datasets import text_classification
import os

NGRAMS = 2

if not os.path.isdir(’./.data’):
os.mkdir(’./.data’)
print(os.path)
train_dataset, test_dataset = text_classification.DATASETS[‘AG_NEWS’](
root=’./.data’, ngrams=NGRAMS, vocab=None)

BATCH_SIZE = 16

device = torch.device(“cuda” if torch.cuda.is_available() else “cpu”)

I was gettting error like ImportError: cannot import name ‘text_classification’

Can anybody help on this ?
Thanks

I think the Colab setup documentation (located at https://course.fast.ai/start_colab.html) might be missing a step. I don’t have a fastai-v3 folder in my Google drive.

How should I proceed?

Hi, you can use my notebook to run lesson3.
https://colab.research.google.com/drive/1VgLDzrIV3aR4GA7fk-tN2KOuF_ll2Ei2

I think you problem is missing the first code in my notebook.

After some deliberation we’ve determined that this method won’t break the TOS, so the directions are back up

FYI folks, @deeplearner and @imrandude both came up with a methodology of turning your colab instances into full Jupyter Environments. This is experimental and Colab may patch this at any moment. Please use at your own discretion. The directions are in the top post. If there are any install issues etc ping me and I’ll work on it.

This means that any widgets will work here!

1 Like

Hi @muellerzr, thanks for posting the method to run jupyter instances out of colab. I am encountering some issues: the tunneling with ngrok and everything goes smooth, but when I open the notebook and try to run something no output happen (and I assume nothing is happening too).
The kernel is correctly running and everything is fine.

The only thing is that I am opening colab notebooks that I stored in gdrive, since it’s available in the root of jupyter file explorer.

Hi,

I am using colab for image classification, however after mounting my g drive and untar the data. I am unable to find the data in my drive. What wrong could i be doing here.

Regards
Sekar

Could you be more specific? :slightly_smiling_face:

Are you trying to extract a tar file from your gdrive to colab?

Yes when i try to untar_data of URLs.PETS in path variable.

And print path i get the following output <bound method of PosixPath(’/root/.fastai/data/oxford-iiit-pet’)>

Not sure how to proceed further

Oh I got it. There’s nothing wrong, the data is being extracted to desired location, you just need to make a soft link to that location to be able to browse it. Execute the following line and you’ll be able to see the directory :slightly_smiling_face:

!ln -s /root/.fastai/data /content
2 Likes