Hi, I am having a trouble while using jupyter notebook. When I download my assignment and try to review it on the jupyter notebook on my local machine, I found that all the images dose not show up. Even if I put it onto Google Colab, this issue still remain. I tried to modify the tag but still it dose not work. Dose anyone has the same issue? If there is a solution, I will be grateful for that.
Image paths are relative to the notebook location.
Please download the entire lab from the jupyter workspace via Lab files
and then click Download all files
Hello, Gehrman.
Thank you for your question.
Besides, what mentor Balaji has suggested, you need to remember, not to modify the images in any manner, otherwise it will loose its metadata.
Hi, thanks to the reply. I did donwload the whole file from the jupyter workspace. But when I tried to put it Google Colab, all the images does not shown no matter what. I tried to put it into my local jupyter with vscode, which I did not usually do because it always has bugs, it actually shows the images. So I wonder is the online jupyter does not support relative paths or other problems occured.
Hello @Gehrman_Yu_74751Xiao,
I think the problem has to do with setting the “current working directory” correctly. I suppose you have uploaded the files to your google drive, and then you have authenticated your Colab to access your Google drive, am I right? If so, please go to your Colab notebook, open a new cell, and then type
!pwd
and then run it. It will show you what the “current working directory” is, and then you will need to change the directory to the right directory by
%cd <path-to-the-right-directory>
You need to look at how the path to the images is written. It is usually a relative path. So, you need to change to the right directory so that it can locate the images correctly using that relative path. I hope I have made it clear. Let me know if you have any questions.
Cheers,
Raymond
Yes, note that on Colab, the files need to be accessed from your “Google Drive”, so you will need to adjust the pathnames. The paths in the notebook assume the straight linux setup of the Docker images that the course uses and that results in a different setup.