Timisoara study group - fast.ai Live

I made a mindmap with what are considered to be the most useful rules of syntax for regular expressions.

If somebody needs the mindmap, I will share it somewhere with you.
You can modify its content as you desire by installing Xmind (Zen or 8) (I made this one in Zen and I recommend it as it is much faster to work with).

2 Likes

Regular expressions get complicated really fast. Note that ImageDataBunch.from_name_func allows you to set a label_func= argument which is a function you can define to label each image. I find it easier for me as instead of grouping with regexp I can just do str.rfind(".") and then extract substrings manually in Python.

For those who had errors on Friday during Google Cloud setup (either because of gcloud-cli, or other packages), below there is an alternative how to do the entire setup, from creating an instance to accessing/running jupyter notebook in the browser:

As far as I remember Fedora distros were plagued with errors and even one Ubuntu had trouble.

1 Like

Hey Teo,
I tried the tutorial you sent but I ran into problems: I can’t select the service field “until I upgrade my free trial account” - see attached.
PS: I’m on Fedora 27.
LE: I upgraded the account. Now I have to wait 1 day for Google’s reply. Thanks for the tutorial!

[Colab] be careful to this one: ConvLearner is now called create_cnn
https://forums.fast.ai/t/platform-colab/28161/7

2 Likes

Lesson 1 is fully mind-mapped

Enjoy :slight_smile:

2 Likes

Does anybody had the following issue when trying to run the instance?

06

Does anybody have also problems connecting to the GCP instance?

Today I’ve received all the time the following error (after gcloud compute ssh command) and only deleting/re-creating the instance solved the problem for a short time (after stopping the instance the problem arose again).

ssh: connect to host 35.204.66.68 port 22: Resource temporarily unavailable
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].

Never mind, I think I have fixed it somehow, but do not know exactly what solution solved the problem.

As I had to permanently recreate instances I’ve compiled a bash script with command aliases, if it helps anyone:

export IMAGE_FAMILY="pytorch-1-0-cu92-experimental"
export ZONE="europe-west4-b"
export INSTANCE_NAME="fastai-standard-compute"
export INSTANCE_TYPE="n1-highmem-8"

alias gnew='gcloud compute instances create $INSTANCE_NAME \
        --zone=$ZONE \
        --image-family=$IMAGE_FAMILY \
        --image-project=deeplearning-platform-release \
        --maintenance-policy=TERMINATE \
        --accelerator="type=nvidia-tesla-p4,count=1" \
        --machine-type=$INSTANCE_TYPE \
        --boot-disk-size=200GB \
        --metadata="install-nvidia-driver=True" \
        --preemptible'

alias gdel='gcloud compute instances delete $INSTANCE_NAME --zone=$ZONE'

alias gopen='gcloud compute instances start $INSTANCE_NAME --zone=$ZONE \
        && sleep 5 && printf "\n------Update fast.ai course repo------\n" \
        && gcloud compute ssh jupyter@$INSTANCE_NAME --zone=$ZONE \
                --command="cd tutorials/fastai/course-v3 \
                        && git checkout . && git pull \
                        && printf \"\n--------Update fastai library---------\n\" \
                        && sudo /opt/anaconda3/bin/conda install -c fastai fastai" \
        && gcloud compute ssh jupyter@$INSTANCE_NAME \
                --zone=$ZONE -- -L 8080:localhost:8080'

alias gstop='gcloud compute instances stop $INSTANCE_NAME --zone=$ZONE'

The content above may be simply saved as a new file called .bash_aliases inside home directory and will be automatically loaded at log-in time by .bashrc under Ubuntu.

These 4 commands may be enough for working solely from terminal (i.e. independent of the GCP webapp).

1 Like

Hi, I have just launched a discussion thread on fastai study groups to gather feedback from organizers and participants to identify best practices and avoid some gaps.

More information in this post. Thank you if you can take a few minutes to participate in the discussion :slight_smile: