Chapter 4 page 144

Errors after running the commands:

metrics = model.evaluate(test_data)
print("Accuracy: ", metrics[“accuracy”])
print("Precision: ", metrics[“precision”])
print("Recall: ", metrics[“recall”])
print(“Confusion Matrix:\n”, metrics[“confusion_matrix”])

49%20PM

01%20PM

Any help will be appreciated… Thank you!

MacBook Pro running MacOS Mojave 10.14.5 should downgrade the system to MacOs Mojave 10.14.4 to make this work?

Is 10.14.5 still in beta? That could explain some of the issues you’re having.

When you do conda list turicreate, what version number does it print out?

Version 5.5 was released a few weeks ago, but the book was tested against version 5.4. So you could try to do the following:

pip install -U turicreate==5.4

This will uninstall v5.5 and install v5.4 in your environment. Does it work now?

Version 5.5 was installed, then I downgraded to 5.4 with the same results.

48%20AM

Weird. The error message is on something inside Turi Create, so it’s not something we really have control over. :slightly_frowning_face:

I would like to delete Anaconda and the installation of the environments with pip that were done by following the instruction in chapter 4 so I can reinstall everything again and follow the instructions one more time that were given in chapter 4, just to make sure that I did not make a mistake following the instructions. I don’t want to leave traces of that. What’s the best approach to erase that?

Thank you!

This is the page I’ve gone back to again and again over the years: Managing environments — conda 22.9.0.post49+dc2c296c3 documentation

It includes instructions for all the common tasks you’ll need to do when working with conda environments.

To delete your environment, run this at the command line:

conda remove --name myenv --all

Replace myenv with the name of your environment, like turienv

If you prefer to use the Anaconda Navigator app, go to the Environments section, select the correct name in the list of available environments, and then click the Remove button below the list.

I just noticed that at the end of chapter 4 there’s a small section of the most relevant commands for Conda, but the link that you have provided is better.

Thank you!

I just reinstall everything as indicated in the book with the same results. This time I installed Python 3.6 from Python.org and choose Python 3.6 for the mlenv.

Is there any other code to replace:

metrics = model.evaluate(test_data)

Thank you!

I reinstall everything, but this time I use Python 2.7 instead of Python 3.6 as indicated in the book.

metrics = model.evaluate(test_data)

Run successfully

print("Accuracy: ", metrics[“accuracy”])
print("Precision: ", metrics[“precision”])
print("Recall: ", metrics[“recall”])

The problem now is here
print(“Confusion Matrix:\n”, metrics[“confusion_matrix”])

21%20AM

I hope you can help me with that.

Thank you!

Apparently something in turicreate broke in version 5.5: Error image_classifier · Issue #1866 · apple/turicreate · GitHub

You can install version 5.4 or wait for 5.6, which should fix this.

pip install -U turicreate==5.4

I’m going to type that command … Thank You!

I just installed turicreate 5.4 as you can see in the screen shots. There must be a way to install this correctly with the same packages that were used by the writer of this chapter.

I was able to run the command successfully with python2.7, at least that is what it seems to me in the previous screen shot:

metrics = model.evaluate(test_data)

print(“Confusion Matrix:\n”, metrics[“confusion_matrix”]) it seems that throw an error. Well the screen shots in my previous post show this clearly.

This are the new results using Turicreate 5.4:

26%20PM58%20PM29%20PM

Maybe you could try turicreate version 5.0 or 5.1 – those were the versions actually used when writing the book. It seems some bugs were introduced in the later versions.

5.1 is the version that works…

Thank you!!!