In course 4, week 3, image segmentation programming assignment, I have a problem while preprocessing the data when I run the code in my Colab (it works fine in Coursera Jupyter Notebook as following):
In the image, you can see the path is in tensor type (cell 14), I tried preprocessing one path (cell 15), it worked and so on with the rest (cell 16).
But Colab tells me:
(cell 14: no problem)
cell 15: stat: embedded null character in path
cell 16: TypeError: stat: path should be string, bytes, os.PathLike or integer, not Tensor.
Why do I get this issue and how can I fix that?
If you want to run things in a different environment, that is beyond the scope of the course. There are no explicit instructions for how to do that.
For one thing, python packages in general mutate pretty rapidly over time and there is no guarantee that the versions used by the course are the same as what you happen to have in your Colab environment. Also note that there are a lot of files that accompany each notebook, so it doesn’t work to just copy the notebook over. That’s probably the source of the issue here. I haven’t used Colab in a while, so I don’t remember how file access works. It probably means you have to load the files into your Google Drive and then figure out how to reference them from Colab. It wouldn’t be too surprising if that involved changing some pathnames and even some functions.