404 error when trying to get weights
Block of code I am running into issue with:
!wget "https://raw.githubusercontent.com/zsylvester/segmenteverygrain/main/segmenteverygrain/checkpoints/checkpoint" !wget "https://raw.githubusercontent.com/zsylvester/segmenteverygrain/main/segmenteverygrain/checkpoints/seg_model.data-00000-of-00001" !wget "https://raw.githubusercontent.com/zsylvester/segmenteverygrain/main/segmenteverygrain/checkpoints/seg_model.index"
--2025-01-10 18:56:48-- https://raw.githubusercontent.com/zsylvester/segmenteverygrain/main/segmenteverygrain/checkpoints/checkpoint Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.108.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2025-01-10 18:56:48 ERROR 404: Not Found.
--2025-01-10 18:56:48-- https://raw.githubusercontent.com/zsylvester/segmenteverygrain/main/segmenteverygrain/checkpoints/seg_model.data-00000-of-00001 Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2025-01-10 18:56:48 ERROR 404: Not Found.
--2025-01-10 18:56:49-- https://raw.githubusercontent.com/zsylvester/segmenteverygrain/main/segmenteverygrain/checkpoints/seg_model.index Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2025-01-10 18:56:49 ERROR 404: Not Found.
If you need a perm place to store the weights, we could do that at Unidata, feel free to email me at tmartin at ucar dot edu
That's because I have replaced the Keras 2 model with a Keras 3 model (and didn't update the Google Colab file). You can load the new model weights like this:
!wget "https://raw.githubusercontent.com/zsylvester/segmenteverygrain/main/segmenteverygrain/seg_model.keras" model = load_model("seg_model.keras", custom_objects={'weighted_crossentropy': seg.weighted_crossentropy})
I will update the Colab notebook but it looks like it also has an issue now with 'ipympl'.
Thanks for flagging this!
Thanks! Yeah I was getting some success yesterday, but this was the road block. I will share my draft notebook if I get to it today. Thanks!
I got a lot further down the road:
https://colab.research.google.com/gist/ThomasMGeo/f926558b47de23c0f44d57bc64849a8f/segment_every_grain_colab.ipynb
cc: @zanejobe
ok I got the interactivity to work, bit of a hack, have to re-start the runtime:
https://gist.github.com/ThomasMGeo/04efc96fbceb54cdd0d173644f244ff3
I'm running into similar issues with the colab version. @zsylvester can you give a shout when you have updated it in the repo so I can keep reviewing it?
@jessepisel did my gist work for you?
Howdy @ThomasMGeo I got the weights downloaded and loaded up. The T4 instance runs out of system RAM at inference time though. I need to spend some more time poking at it this week to see if I can get this version running, but I made it further through it so far!
Worth the 10 bucks for an A100 for a few hours 😆
Hi @jessepisel and @ThomasMGeo - I have updated the Colab notebook so that it installs everything that needs to be installed and loads the weights for the models.
I think the only issue that remains is that you have to restart the runtime after installing 'ipympl'. Thanks @ThomasMGeo for the tip on restarting the kernel.
I have also added the workflow for segmenting large images.