Comments (6)
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.
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.
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.
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.
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.
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)
- CH12: Custom Models: number of iterations for lower Residual Block HOT 1
- [BUG] Chapter 10: KerasRegressor vs Sci-Keras issue
- Where Can I find Appendix A? Is it in book or files? If files where? HOT 1
- [QUESTION] Chapter 14 error
- [BUG] [Chapter2] ValueError when calculating the correlations in corr_matrix = housing.corr() HOT 3
- [BUG] Chapter 4, Notebook: 04_training_linear_models.ipynb, Cell 47 HOT 4
- I get "TypeError: 'module' object is not subscriptable" for cm module HOT 2
- [BUG] 'my_mnist.data' HOT 1
- Chapter 10 neither attribute keras.wrapper nor keras.__version__ being found :/ HOT 1
- [QUESTION] Chapter 10 Exercise 10 Factor parameter HOT 1
- [QUESTION]What is the difference between predict_proba, decision_function and predict function and how to choose HOT 1
- [BUG] HOT 1
- [BUG]sgd_reg = SGDRegressor(max_iter=1, tol=-np.infty, warm_start=True, penalty=None, learning_rate="constant", eta0=0.0005, random_state=42)
- [BUG]X = iris["data"][:, 3:] # petal width y = (iris["target"] == 2).astype(np.int) # 1 if Iris virginica, else 0
- [BUG]09 unsupervised learning
- [QUESTION] Chapter 10 RandomizedSearchCV returned best model having worse performance. HOT 1
- [QUESTION] Chapter 2 StratfiedShuffleSplit
- Machine Learning
- [BUG] [Chapter 4]: Equation rendering issue in "exercise 12" solution in 04_training_linear_models.ipynb
- [QUESTION] About Cross-Validation in Chapter2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from handson-ml2.