Coder Social home page Coder Social logo

Comments (6)

ShaunFChen avatar ShaunFChen commented on May 18, 2024 2

Yeah graphviz need to be installed by conda. I guessed it can be fixed by adding python-graphviz in docker/DockerFile at well. Not sure if it is an independent issue from docker building.

Meanwhile, instead of re-install the container every time, we can go inside the container with root permission and run the installation manually. First, run the docker by make run as usual, and then open another session do:

$ docker exec -it -u root handson-ml2 bash

You supposed to log in the container and get something like (base) root@7d52911ef9e4:/home/devel/handson-ml2#, then run the conda installation command after that as:

(base) root@7d52911ef9e4:/home/devel/handson-ml2# conda install -y -c conda-forge python-graphviz

I just checked it fixed the issue in "06_decision_trees.jpynb", didn't go further to other notebooks yet.

from handson-ml2.

ShaunFChen avatar ShaunFChen commented on May 18, 2024 1

Hi @qwertypo888,

Thanks for your feedback, I kept searching for the reasons causing this issue and possible solution. My apologies for my previous comment, it was not enough to run the materials. Since following the same steps, I suggested check by docker container ls. If there's already a container named "handson-ml2", then do docker rm -f handson-ml2 to clean the wrong one.

This issue seems to caused by both conda and docker image. According to the thread reported recently, the problem from conda was still pending to be fixed. Our problem was triggered by pulling packages from conda-forge, so conda hanged forever to solve the confliction. I ran the initial code to test the environment of the docker image but I got:

$ docker pull continuumio/anaconda3:2019.03
$ docker run -i -t continuumio/anaconda3:2019.03 /bin/bash
$ python -V
Python 3.7.3

Many threads suggested creating a conda environment with python 3.6, but in this case, we need the base environment.

Overall, it works for me to downgrade by simply adding:

RUN conda install -y python=3.6

in docker/DockerFile as the 2nd line (still pull FROM continuumio/anaconda3:2019.03.) The notebook can work in my case now.

from handson-ml2.

qwertypo888 avatar qwertypo888 commented on May 18, 2024

I had the same problem and I was able to build the image by following your suggestions. However, it later complained about Matplotlib not found when I tried to run the notebooks inside the container. Did you have the same problem?

from handson-ml2.

qwertypo888 avatar qwertypo888 commented on May 18, 2024

Hi@ShaunFChen,
Thanks for the suggestion, it seems to be working better. But it has problem importing "graphviz", for example the 3rd code block of notebook "06_decision_trees.jpynb". Does graphviz work in your case?

from handson-ml2.

qwertypo888 avatar qwertypo888 commented on May 18, 2024

Great!

I added python-graphviz to the end of the following line in Dockerfile:
RUN conda install -y -c conda-forge ... python-graphviz
and now I can run through the "06_decision_tree.ipynb" notebook without issue.

The key is to use python-graphviz, not graphviz (that was really confusing).

@ShaunFChen, Thank you so much for the suggestions!

from handson-ml2.

ageron avatar ageron commented on May 18, 2024

Hi everyone, thanks for your contributions. I fixed the Dockerfile a few months back, everything should work fine now. I just tried building an image, and it looks good. I pushed it to docker hub, so you should be able to run docker pull ageron/handson-ml2:latest. However, I won't be building those on a regular basis, so it's probably safer to build your own, or else it might be outdated.

Closing this issue, but feel free to re-open it if something is wrong.
Cheers!

from handson-ml2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.