deep learning course by udacity
Over this readme the name of the image will be udacity
.
You can name containers by using the --name
- run-assignments
- find virtual machines ip
- how to login into docker hub
- save current docker
- access docker container through a terminal
- show images in ipython notebook
docker run --name udacity -p 8888:8888 -it --rm b.gcr.io/tensorflow-udacity/assignments
$ docker-machine.exe ip default
192.168.99.xxx
go to http://192.168.99.xxx:8888
$ docker login https://index.docker.io/v1/
issues with login in windows? check this out DockerToolbox in windows Login/push doesnt works properly (With a workaround)
- login to docker hub
- To get current container names do
docker ps
- commit container
docker commit udacity user/repository
- push the container
docker push index.docker.io/username/repository
docker exec -it udacity bash
docker run --name udacity -p 8888:8888 -v /c/Users/username/yourpathto/assignments/:/notebooks -it --rm b.gcr.io/tensorflow-udacity/assignments
Note: on windows machines you cannot mount volumes outside of c:/Users/username
because
reasons
If you are using Docker Machine on Mac or Windows, your Docker daemon has only limited access to your OS X or Windows filesystem. Docker Machine tries to auto-share your /Users (OS X) or C:\Users (Windows) directory.
you might be getting memory errors like the following:
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
<ipython-input-8-5158e101f707> in <module>()
37 print('Labels:', labels.shape)
38 return dataset, labels
---> 39 train_dataset, train_labels = load(train_folders, 450000, 550000)
40 test_dataset, test_labels = load(test_folders, 18000, 20000)
<ipython-input-8-5158e101f707> in load(data_folders, min_num_images, max_num_images)
34 print('Full dataset tensor:', dataset.shape)
35 print('Mean:', np.mean(dataset))
---> 36 print('Standard deviation:', np.std(dataset))
37 print('Labels:', labels.shape)
Try changing the RAM you provide to your docker container.
To do this use the -m
or --memory
example:
docker run --name udacity --memory 4096m -p 8888:8888 -v /c/Users/username/yourpathto/assignments/:/notebooks -it --rm b.gcr.io/tensorflow-udacity/assignments
To check that the change of memory took place run the following script in a the python notebook.
import os
mem_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') # e.g. 4015976448
mem_gib = mem_bytes/(1024.**3) # e.g. 3.74
If the memory is not what you expect you might need to turn down your containers, open virtual box and change the ram settings there before running the docker run
cmd again.
you need to add %matplotlib inline
to be able to show images in your ipython notebook.
# you need a matplotlib inline to be able to show images in python notebook
%matplotlib inline
plt.imshow(train_dataset[0])
plt.title("Char " + str(train_labels[0]))