Hi, I downloaded the full code and data of this section to run on my local.
But when you run a line of code, the kernel always dies.
This line of code is:
image_list_ds = tf.data.Dataset.list_files(image_list, shuffle=False)
why is this?
That is probably a “versionitis” problem. Notice that these notebooks were last updated in April of 2021 when they upgraded from TF1 to TF2. So they use the versions of TF and all the other packages that were current more than 2 years ago. But things evolve pretty fast in this world, so there is no guarantee you can just run all that code with the current versions of all the packages and have everything just work smoothly.
Sorry, but there is no “official” documented way to deal with this. Here’s a recent thread which discusses this a bit more and gives some links to what documentation we do have.
The line you’re asking about shouldn’t fail. It’s just listing files here. I’m using tensorflow version 2.12.1 and it works as expected.
Here’s a stackoverflow post on steps to enable logging locally and share more information on why the kernel dies.
One thing to note is that the lab uses tf.data.Dataset.list_files
which isn’t necessary. You can ignore that cell since it’s not used anywhere.
It’s sufficient to use tf.data.Dataset.from_tensor_slices(image_files)
since we’re using a list of file paths anyways.
thanks!
Yes, that code is not necessary.
Thank you, the linked pages made me learn something new.
Hi, I have solved my problem.
It because of version conflict
and I used follow code:
import os
os.environ[‘KMP_DUPLICATE_LIB_OK’] = ‘TRUE’