AWS AMI available for testing

Hi @Jeremy

I wasn’t sure if learn.save was fully persisting the complete model (weights and all) on the hard disk, so it could be simply loaded in a brand new session / notebook, or if it merely recorded information that is accessible and makes sense only within the currently running session.

To make this clear, if I created something I like and used learn.save, then powered down my AWS instance and came back the next day, can I use learn.load to reload the fully configured model into a new notebook on my newly running instance, without any preparatory work apart from loading libraries (and possibly data?), in my brand new session?

Yup. I mean - you first need to construct the model (e.g. using pretrained()), but then you load the weights into it.

1 Like

Thanks Jeremy

Is this something you could demonstrate, or have demonstrated or blogged about? The reason why this is important is because I have lost heaps of time and work when I drop my internet connection, so I was wanting to see if there is a way to recover more quickly back to my last saved position.

1 Like

Once you’ve created your learn object in the usual way, just type learn.load('filename'), and that’s it!

Just like you have been doing all along?

OK, I will try it on one I saved a few days ago - thanks!

Hi Jeremy

I finally got around to trying this, and got an error. Are you able to help me undertand what I did wrong? I tried finding something that looked like this saved name on my hard disk but couldn’t locate it. Does it get affected by any other process such as updating code through git or conda env upgrade?

Yes if the model definition has changed it won’t be able to load it. Also, if you save with precompute=False, you must load with the same value (and visa versa).

@jeremy Is it possible to share the script used to create the ami-8c4288f4 gpu-p2 AMI we use for the course?

I would like to see how the compatible versions of Nividia drivers, Cuda, CuDNN, Pytorch, Keras, Tensorflow are installed.

As I mentioned earlier in the thread, there’s nothing to see. Just grab the AWS Deep Learning AMI, and then simply install anaconda, git clone the repo, and conda env update you’ll be ready to go!

3 Likes

At work we do not have access to community AMIs, so I have to recreate the box from vanilla ubuntu. So just wanted to make sure I install the correct and compatible versions of Cuda and CuDNN.

After that I can always install Anaconda, git clone the repo and conda env update to the get the libraries.

This might help. https://aws.amazon.com/blogs/ai/new-aws-deep-learning-amis-for-machine-learning-practitioners/

The AWS Deep Learning AMI is not a community AMI, it’s official. Maybe you can access that?

Thanks for the suggestion. Will pursue the AWS DL AMI route.

@jeremy I created an instance with your AMI. but nothing is installed when i run lesson 1. cuda, torch and bcolz keep showing import error.

please advise, it has taken me forever to finish fast.ai lesson 1 due to this issue

@arunabh Spin up a instance with plain Ubuntu 16.04 and Try Running the paperspace bash script here . If you get any error in the inital few lines comment/remove them. It will work fine i suppose.

thanks. will try

Still does not work. torch not found is an error that pops up again and again. Also, a lot of python libraries are not installed when running the jupyter notebook

can you post what error you have got ? Did you run the script by SSH into the Instance using putty like softwares: Web GUI slogs. if you still face the problem.
Try the following:

  1. If you have got the Cuda drivers and CUDNN and anaconda Setup. Else run the commands from the paperspace script line by line.
  2. Do a git clone on Fastai repo. Delete Fastai Environment if present using : conda env remove -n fastai
  3. Create a new environment using the environment.yml present in the fastai repo.
    Hope it helps.
    ~Gokkul

May I know how this was solved? @arunabh
Have the same kind of problem. Though with bcolz.

Hi everyone, my post that solves the question “how to setup fastai in an Amazon AWS region without fastai AMI like in Europe”.

1 Like