Google Marketplace VM


(Prabhat Kr Rai) #1

I created a Vm using marketplace with experimental PyTorch installed that gives me access to fastai library
How can I activate the environment so that I can run jupyter notebooks like it worked on AWS.
It gives me an error no module named ‘bcolz’
This is the same error I got when I had run the notebooks with ‘conda activate fastai’

Please help me through this.


(shikun chen) #2

If you use AWS, there is a Fastai VM image, if you use GCP, there is also a VM image.

AWS: https://github.com/reshamas/fastai_deeplearn_part1/blob/master/tools/aws_ami_gpu_setup.md

GCP: [https://blog.kovalevskyi.com/google-compute-engine-now-has-images-with-pytorch-1-0-0-and-fastai-1-0-2-57c49efd74bb]


(Prabhat Kr Rai) #3

Hi,
thanks for answering. I have gone through this article. I am using GCP and it is not importing ‘bcolz’ module.

Can you walk me through the steps?
I have my VM setup with Fastai VM image and I have pulled the fastai repo from github
What should I do now to be able to run the course notebooks with all dependencies working?


(shikun chen) #4

Hi, I found that the best way is using AWS FasiAi image, for GCP, there are much issues, you can refer this thread. So basically, you have to use virtual env and install the libraries one by one. I don’t know whether there is a better solution.


(Prabhat Kr Rai) #5

I have free credit in GCP. So, I want it to work on it.
It was working flawlessly on my computer engine instance but it isn’t on this fastai image in GCP.
I tried the link but they didn’t work.


(Pankaj Mathur) #7

Try this, I was facing same issue on GCP, AWS, PaperSpace and Azure…

lmk if you still face same issue


(shikun chen) #8

Hi, prabhatkrai. I don’t know whether you solved this problem.
After many trials, I found that one way worked for me.
So, you should create a pure GCP VM instance without Fastai image. (Ubuntu 16.04)
And follow this article
Some errors may occur, ignore them!

To run the course’s Notebook, you still need install some libraries manually as suggested in this post using conda or Pip!

It may take some time, by it worked very well for me.

Feel free to ask me if you have any other issues!


(Prabhat Kr Rai) #9

Thank you for your responses.
I’ll check them out and let you all know!
This has been one of the most active and helpful forums I’ve been part of till now.
I am using conda


(Prabhat Kr Rai) #10

The jupyter notebook is showing error. The imports are working now!
I imported them individually on command line by starting python in fastai environment but notebook is not launching.


(shikun chen) #11

Hi, I do believe there is something wrong with Jupyter Notebook configuration. Instead of “jupyter notebook”, you should type “jupyter notebook --ip=0.0.0.0 --no-browser”

Hope this works for you.


(Prabhat Kr Rai) #12

I got it to work.
remote access wasn’t allowed.
Thank you! It is working now.
I hope someone works out a way to run the Fastai image VM in GCP marketplace as that will be considerably hasslefree as all libraries are there installed from the start.
Thanks again.


(shikun chen) #13

Good to hear that! I hope so, the AWS FastAi with P2 instance cost 0.9$/h.

Anyway, happy learning!


(Viacheslav Kovalevskyi) #14

@prabhatkrai Please do keep in mind that there is no need to start Jupyter Notebook or Jupyter Lab, it is already running on the GCP VM. The only thing that is need to be done after the creation is to SSH to the instance with port mapping like this:

gcloud compute ssh $INSTANCE_NAME – -L 8080:localhost:8080

This is it, now you can open your browser at localhost:8080 and use fastai. I just have verified on the latest image:

may I ask you to try this? Also, I want to apologize for your inconvenience, may I ask you to give me your mail and I will try to share some GCP credits with you


(Prabhat Kr Rai) #15

My email id is prabhatkumar27@gmail.com.
I did the same as written in Medium article on GCP VM.
When I ran this, it wouldn’t import bcolz, cv2 and others.
The rest worked fine. :slight_smile:


(Viacheslav Kovalevskyi) #16

Now I see the problem. Here are quick fix and I am going to initiate new build of images that have packages pre-installed. Fix:

  1. log in via SSH to the instance
  2. In the terminal run:

sudo /opt/anaconda3/bin/pip install --force opencv-python
sudo /opt/anaconda3/bin/pip install --force bcolz

you will see something like:


(Viacheslav Kovalevskyi) #17

after executing these commands you can use them in the Jupyter Lab:


(Prabhat Kr Rai) #18

Hey!
I tried this and it worked.
Thanks for this and I think it’ll be great to pre-install them as I couldn’t understand how to install these packages in fastai’s environment.
Now I understand how it is working after reading your replies.
Thanks!


(Jeremy Howard) #19

Neither of those are necessary for fastai v1 FYI @b0noi . If people are reporting problems here, it suggests they are trying to use fastai 0.7.


(Prabhat Kr Rai) #20

I started my VM with Pytorch v1[experimental] and logged in via SSH into it.
After that, I used git pull to get fastai from GitHub for the courses as I am under the impression that other modules and dependencies are already installed on this.
What did I miss?


(Jeremy Howard) #21

The courses use an older version of the library. The GCP image is for fastai v1, which is not used in any course yet.