Week2_Lab: TypeError occurs when try to train the imbalanced_model

I tried to rewrite the whole exercise with jupyter notebook at venv on Mac.

When I tried to train the imbalanced_model, TypeError occurs:

It’s saying: TypeError: array() takes 1 positional argument but 2 were given.
But I did not change nothing about array.

Can’t figure where goes wrong, and goole can’t help.
Any help is really appreciated, thanks!

Hi @Damon
maybe there is a misalignment between the Tensorflow versions available under Colab and under your MAC.
Please double check the Tensorflow version on your MAC.
Anyway you can avoid to run the fit process and keep the pretrained model already available.You have just to download every file under the imbalanced_model folder from Colab and copy all the stuff in your environment.

1 Like

Thanks @fabioantonini ,

There is a misalignment between my TF versions and the Colab’s. And I can’t align them since TF 2.4 is the latest version a Mac M1 can get by now.

I have downloaded all the files needed and configured stuff according to the Lab description step by step. And I don’t understand why a different TF version would cause such a TypeError, where exactly the different TF version brings in conflict ?

And I also tried to use the pre-trained model, but the same TypeError occurs when I run the cell to compute the accuracy_score & balanced_accuracy_score in imbalanced dataset case.