Skip to content

Update docker_run.sh #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update docker_run.sh #8

wants to merge 1 commit into from

Conversation

johndpope
Copy link

@johndpope johndpope commented Feb 2, 2021

I want to load a local pickle file into docker so crafted this extra mapping -

I put pickle file in git repo directory / is it best place? maybe not due to git tracking.
I nest it into a workspace folder on docker container to map back to host.

./docker_run.sh python3 generate.py --outdir=out --trunc=1 --seeds=85,265,297,849 \
    --network=/workspace/ffhq-cartoon-blended1.pkl    

this works and loads fine. If there's a simpler way - I'm all ears.

P.s Do we we need the gpu guff to get 3090 card working at scale?
docker run --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 --gpus all \

docker run --gpus all -it --rm -v `pwd`:/scratch --user $(id -u):$(id -g) \
docker run --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 --gpus all \
--mount type=bind,source="$WORKDIR",target=/workspace \
-it --rm -v `pwd`:/scratch --user $(id -u):$(id -g) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"-v pwd:/scratch" mounts your current working directory under /scratch. It looks like your change adds another bindmount for workdir under /workspace. So both /scratch and /workspace should be pointing to your host's current dir.

Perhaps you were using paths like /workspace/something.pkl when /scratch/something.pkl would've worked without the above change?

I will comment on the bug. The docker_run.sh is kind of a sample thing that I expect everyone to adapt to their needs. These kinds of scripts never do exactly what multiple people want from docker run, so the simpler they are in a repo like this, the better.. this way it's easier to understand it and fork it to one's own needs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes thanks Janne - /scratch/something.pkl seems fine. Just need some help for newbies in readme

I like the shell wrapper - it helps hide the guff and also get the user credentials correct. I've dived into docker and end up in the bash - then spitting out images which can't be seen by the host / this is solved by the user id parameter - so far - so good - works elegantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants