segmenteverygrain icon indicating copy to clipboard operation
segmenteverygrain copied to clipboard

404 error when trying to get weights

Open ThomasMGeo opened this issue 1 year ago • 10 comments

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.

ThomasMGeo avatar Jan 10 '25 18:01 ThomasMGeo

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

ThomasMGeo avatar Jan 10 '25 20:01 ThomasMGeo

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!

zsylvester avatar Jan 11 '25 13:01 zsylvester

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!

ThomasMGeo avatar Jan 11 '25 19:01 ThomasMGeo

I got a lot further down the road:

https://colab.research.google.com/gist/ThomasMGeo/f926558b47de23c0f44d57bc64849a8f/segment_every_grain_colab.ipynb

cc: @zanejobe

ThomasMGeo avatar Jan 24 '25 01:01 ThomasMGeo

ok I got the interactivity to work, bit of a hack, have to re-start the runtime:

https://gist.github.com/ThomasMGeo/04efc96fbceb54cdd0d173644f244ff3

ThomasMGeo avatar Jan 27 '25 23:01 ThomasMGeo

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 avatar Apr 18 '25 16:04 jessepisel

@jessepisel did my gist work for you?

ThomasMGeo avatar Apr 18 '25 20:04 ThomasMGeo

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!

jessepisel avatar Apr 21 '25 22:04 jessepisel

Worth the 10 bucks for an A100 for a few hours 😆

ThomasMGeo avatar Apr 21 '25 22:04 ThomasMGeo

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.

zsylvester avatar Apr 24 '25 19:04 zsylvester