docker-torch-rnn
docker-torch-rnn copied to clipboard
Noob Question: How do I use this with my own files?
Hi,
I'm using the Docker file and it works great with the example shakespeare text.
I'm trying to run:
docker run -it -v ~/data2:/data2 crisbal/torch-rnn:base bash
to mount my data folder and use it, but it doesn't show up. It works for other docker files, so are there any permissions I need to change? Or is there another way I can run it using my data?
I'm new to this and appreciate the help. Thank you
Hello
Hmmm, that should work indeed.
Are you really sure the folder is not there? Can you please post the output of:
cd /
ls
cd data2
Also you probably want to mount it at /root/torch-rnn/data2
since that's the folder where the script is installed.
Thank you! You're right, it was there - I was looking for it inside the torch-rnn folder. I've changed to mount it there, works now. Thanks :)
Another noob question: How do we save the output files to our own filesystem?
@amirkhanaursrk If they are in the location of the folder you mounted when you stop the docker container they should still be there.
For example if you mount the folder ~/mydata
docker run -it -v ~/mydata:/root/torch-rnn/data2 crisbal/torch-rnn:base bash
all the files placed in the folder /root/torch-rnn/data2
will be synced with ~/mydata
Thank you! That sure does work!
One last noob question - how should one go about sampling in a detached setting with docker?
I tried the following script after copying the files generated by the training to my home directory:
#!/bin/bash
docker rm -f $(docker ps -aq)
docker run --rm --name container_container -tid crisbal/torch-rnn:base bash
docker cp torch-rnn/cv/ container_container:/root/torch-rnn
OUTPUT=$(docker exec -it container_container th sample.lua -checkpoint cv/checkpoint32100.t7 -length 200 -gpu -1)
echo $OUTPUT
The script failed on the OUTPUT line, giving the following error:
/root/torch/install/bin/luajit: cannot open <cv/checkpoint32100.t7> in mode r at [C]: at 0x00406670l/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
When I sample directly from a shell in the container, there is no issue.