docker-torch-rnn icon indicating copy to clipboard operation
docker-torch-rnn copied to clipboard

Noob Question: How do I use this with my own files?

Open grishmarao opened this issue 7 years ago • 6 comments

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

grishmarao avatar Oct 23 '17 14:10 grishmarao

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.

crisbal avatar Oct 23 '17 15:10 crisbal

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 :)

grishmarao avatar Oct 23 '17 16:10 grishmarao

Another noob question: How do we save the output files to our own filesystem?

smirki avatar Dec 10 '17 15:12 smirki

@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

crisbal avatar Dec 10 '17 15:12 crisbal

Thank you! That sure does work!

smirki avatar Dec 10 '17 15:12 smirki

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.

SebastianVarma avatar May 04 '18 03:05 SebastianVarma