AttributeError: 'list' object has no attribute 'set_data'

Hi, I am currently in the Optimization Algorithms set of videos. Here i am in the part where we plot all the Learning Algos one by one. I have successfully plotted the static plot of the Gradient Descent using 3-d plotting, but the same for Dynamic plotting using the Animated Video is throwing up the error stated in the title.

Kindly find the link of my colab notebook below.

https://colab.research.google.com/drive/1oMzF6UxC1t_6YLD-5SqdHTTGymTWTWtI#scrollTo=OuvWy6PfnE86

P . S - I just found out that the animation works fine when i select the 2d visualization but kinda messes things up for the same in 3d. Moreover, i am facing a new issue where i found out that when i used the initial points as provided in the videos, for those points in the videos reaching the global minima, my version of coding failed to do so. Kindly address this issue also.

This notebook is not accessible

Kindly look into this again

https://colab.research.google.com/drive/1oMzF6UxC1t_6YLD-5SqdHTTGymTWTWtI#scrollTo=MuT8C9OBCAox


@khalid_0800 I couldn’t execute as it needed some other data file in between. If you can separate out the relevant code in a different notebook (instead of all your work from the beginning of the course), it will be easier to debug.

https://colab.research.google.com/drive/13F1UmJRH3SUV-YF1jTHlxQHXV7ASpK-Y?usp=sharing


You missed the coma after line2 :slight_smile: . Return value of ax.plot is a list of lines and without comma, return variable will be assigned the whole list instead of Line2D() object.

Notice the return value of ax.plot with and without comma in figure below:

1 Like

Thank You :+1: :smiley:

The AttributeError is an exception thrown when an object does not have the attribute you tried to access. The ‘list’ object has no attribute ‘split’ error is that you’re trying to call python split function on the whole list of lines, and you can’t split a list of strings, only a string. So, you need to split each line, not the whole thing.