Cannot use C4W4 material offline

Hi everyone,

I am having some issue with the exercise C4W4: Art Generation with Neural Style Transfer

Everything works fine online, however, if I download the Jupyter notebook and try to run it, I get the following error:

AttributeError: module ‘tensorflow._api.v1.random’ has no attribute ‘set_seed’

when running the command: tf.random.set_seed(272). I searched a bit here and there, and I tried options like:

import tensorflow.compat.v1 as tf

However this did not solve my problem. Any help/suggestion is very much appreciated.


1 Like

In the same cell, I cannot run the following command. Basically I cannot read the pretrained weights from the file *.h5. This is very strange that I cannot re-run the same file offline. I appreciate it very much if some one could please help me with this.

vgg = tf.keras.applications.VGG19(include_top=False,
input_shape=(img_size, img_size, 3),

ValueError: The weights argument should be either None (random initialization), imagenet (pre-training on ImageNet), or the path to the weights file to be loaded


I have moved this post to the DLS Course 4 category. Make sure if you have any course-specific doubts, explore the specialization category and post in the relevant course subcategory as course-specific mentors are actively answering the queries there and the threads in the general discussion might not come on their radar and remain unanswered at times.