(C4 W3 A2) Plot_model does not work

When implementing the U-Net Image Segmentation assignment, the call to plot_model

tf.keras.utils.plot_model(unet, show_shapes=True)

results in an error, with traceback

'You must install pydot (pip install pydot) ’
154 'and install graphviz ’
155 '(see instructions at Download | Graphviz) ’
156 ‘for plot_model/model_to_dot to work.’)

This never happened in earlier assignments. the installation of Graphviz seems to be fraught.
What to do?
Thanks for helping

Are you working in the Coursera Labs environment, or in something of your own?

I refer to work in the Coursera environment. The command worked for all previous assignments.
It is not working now.
(I also attempted to do it in my own environment and it also failed, with the same suggestion to install Graphviz. I tried to install it, with Anaconda Nav or directly from the console, but failed. Even the Graphviz website states that there are “issues” with installation.)

Thanks a lot for helping

Sorry, I don’t have any experience with errors involving Graphviz. I’ve actually never heard of it.

I understand. but the question is not about Graphviz; it is why plot_model is failing in the Coursera environment. Perhaps you could check whether it fails when you attempt to graph a model in Coursera. I doubt it is a local issue with my computer, because everything else in the Coursera environment works.

I will take a look at this and report back.

Hello,

Can you share the screenshot of the error you are getting?

Did you try refreshing work environment and re-run every cell one by one?

Where exactly do you see this call? I just searched the notebook file, and I did not find any reference to plot_model, or to tf.keras.utils in any form.

Please post a screen capture image.

It is under TRAIN THE MODEL, exercise 4.2 which is not part of grader cell.

Here’s what my notebook says.
image

That’s not “plot_model()”.

And plt is imported from matplotlib, not tf.keras.plot.

image

Maybe you have an old copy of the notebook?

Hi,

I have the same version, Tom.

based on his error message. I felt he is using his local Jupyter notebook or there is some metadata error.

Because his error tells 155 see instructions at Download should not come as the cell was given already by the grader and he had to only run the cell.

I suppose if he refreshes and update his work environment, it should get him the latest version. Or the same Reboot step.

But he should first share the screenshot of his error as he has shared only a part of the error, for anyone to understand more clearly about his issue.

Regards
DP

Dear Mentors, thanks for your concern! :heart_eyes:.
I append below four screen shots.
(1) A screenshot from an earlier assignment (transfer learning with Resnets), showing the use of plot_model (imported from tf.keras.utils) in the Coursera environment. (Last year).
(2-4) Then three screen shots of a traceback of the error I am getting now, also in the Coursera environment, when I use the same statement in screen shot 1, trying to graph the semantic segmentation assignment model.
Sometimes I get the error traced in the error message, referring to pydot(), other times the one in red in screen shot 3, referring to the need to install Graphviz. Don’t know exactly why I get one or the other. The point is: plot_model does not work in the present Coursera environment.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Coursera_error
XXXXXXXXXXXXXXXXXXXXXXXX



Coursera_error3


Coursera_error2

I recommend you install the current notebook. Yours is obsolete.

I will verify the details later today, but I believe there have been changes on the server end of this assignment, which make your old notebook unusable.

Hello Eduardo,

If you have saved a copy of this work assignment which you have done in your system, then follow these steps

Click File, then open, you will find this files related to this assignment. Select all the files and delete it.

Now you will find a 404 error on the web page. At this time, click Help on the top right hand corner, then Reboot.

Once Reboot is done, Click the help again, then Get the Latest version and then Update Lab.

Please make sure before you do these steps, you have cleared you cache and browser history.

Once you have updated these steps, you should have the latest version/copy of the assignment. Re-do your assignment.