Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem loading a generative model from hub #9

Open
AlexandreAdam opened this issue May 26, 2021 · 10 comments
Open

Problem loading a generative model from hub #9

AlexandreAdam opened this issue May 26, 2021 · 10 comments

Comments

@AlexandreAdam
Copy link

When I follow the example script given in README.md, I get the following error when I call the first line of code:
OSError: https://github.com/McWilliamsCenter/galsim_hub/blob/master/hub/Lanusse2020/model.tar.gz?raw=true does not appear to be a valid module

I use version 3.8.10 of python and gcc version 7.5.0.

Here are some relevant environment package versions

tensorflow==2.5.0
tensorflow-hub==0.12.0
galsim==2.2.4
numpy==1.20.3
astropy==4.2.1
@sreevarsha
Copy link

This issue persists, - I get the same error : OSError: https://github.com/McWilliamsCenter/galsim_hub/blob/master/hub/Lanusse2020/model.tar.gz does not appear to be a valid module. Please advise, thank you.

@EiffL
Copy link
Member

EiffL commented Dec 6, 2022

Hey guys, yeah it's very unfortunate, and I haven't fixed the issue yet :-( The problem is that the models are stored on github LFS that has a very low bandwidth allocation per month of 1GB.

Apparently even though we are still at the beginning of the month, people have already downloaded the model/cloned the repo enough time to max out our bandwidth allocation.

The long term solution to this problem (apart from paying GitHub some money...) is to move the storage to Zenodo, but it involves a bit of recoding >.<

I don't have a separate copy of this file with me at the moment, I will try to post it here later today as a separate link.

@sreevarsha
Copy link

Thank you :)

@EiffL
Copy link
Member

EiffL commented Dec 19, 2022

Hi @sreevarsha, I have uploaded the model weights on zenodo. You should be able to use them with this command:

import galsim
import galsim_hub

model = galsim_hub.GenerativeGalaxyModel('https://zenodo.org/record/7457343/files/model.tar.gz')

Let me know if this works for you, I can then make the changes permanent in the library.

@sreevarsha
Copy link

Hi @EiffL Thanks so much - I'll try it and let you know :)

@sreevarsha
Copy link

Hi @EiffL , thanks so much - it works (y) - is it possible to generate images with particular dimensions (e.g. 32 x 32 x 1) - please advise, thanks

@EiffL
Copy link
Member

EiffL commented Dec 20, 2022

Ahhh that's great :-)
The neural network will generate stamps of fixed sized, but through galsim you can generate stamps of any size you want

@sreevarsha
Copy link

Ok great, thank you :) One last question - the images that are generated by the network/model - they appear noisy - is there a way to generate noiseless images? or is this simply an optical effect ?

@EiffL
Copy link
Member

EiffL commented Dec 21, 2022

hummm they should not have noise in them, unless you add it. This being said, very faint galaxies may have some very low surface brightness features that could look like noise if no noise is added to the image.

Could you show me an example of the python code you use and a plot of one your galaxies?

@sreevarsha
Copy link

Hi, sorry I forgot to edit the previous question - it was some weird bug in the code, now it comes out fine (y) thanks so much and apologies :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants