Issues about Chapter 4
When I trying to run the In[64] from Chapter 4, the jupyter notebook always return this error:
boolean index did not match indexed array along dimension 0; dimension is 150 but corresponding boolean dimension is 100000
May I humbly ask is this my own problem or does a problem exist in those codes? Thank you so much!
Hi @YecanLee , Thanks for your feedback. I cannot reproduce this error. When in doubt, you can always run the code using Google Colab. For example, the notebook for chapter 4 is available on Colab here: https://colab.research.google.com/github/ageron/handson-ml2/blob/master/04_training_linear_models.ipynb
I just ran it and saw no error in cell 64, or anywhere else.
Please make sure you're running the latest version of the code:
cd /the/path/to/the/project/handson-ml2
git pull
If you modified the notebooks and you want to cancel your changes, run:
cd /the/path/to/the/project/handson-ml2
git checkout 04_training_linear_models.ipynb
Also make sure you're using the latest version of the libraries. For example, if you're using Anaconda, run:
cd /the/path/to/the/project/handson-ml2
conda activate base
conda env remove --name tf2
conda env create -f environment.yml
conda activate tf2
Lastly, make sure you run the cells in order.
If this does not fix the issue, please copy/paste here the exact code you're running, as well as the full exception stacktrace.
Hope this helps.