-
Notifications
You must be signed in to change notification settings - Fork 18
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
Building the model with (None, None, 3)
#11
Comments
One solution might be to initialize the model every time it receives a new input with the spatial resolutions of the input and then load the weights and then run inference. But it's extremely inefficient. I have added extensive comments in |
I've just tried the create_maxim_model on a new environment and I didn't get this error |
Did you try changing the resolution accepted by This line of code: maxim-tf/create_maxim_model.py Line 29 in 12df753
|
yes, it works but when I define an input_resolution=512 maybe I'm doing something wrong? |
I'll try more tomorrow, I'll ping you when I start |
Sure. Let me know what you encounter. Maybe attach a Jupyter Notebook? |
Hacked around this by introducing a |
Is this solution ideal? What would it require to natively support any sized image, perhaps with an independent X & Y resolution that is a multiple of 64? Do we need to retrain and re-export the model with (None, None, 3)? I'm keen to help make this work in TFJS, as long as it works on arbitrary sized images without a big performance or quality hit. I've got a 4090 that I can dedicate to re-training, if needed, and I'm reasonably competent with TF/TFJS for inference.
I've managed to adjust this sort of internal issue in the model before. I'll start poking around in the model code to see the resolution-dependent bits. |
Changes are being done here: #24 |
The original MAXIM model can accept images of any resolution even though it was trained on 256x256x3 images.
But this doesn't constrain the MAXIM model to accept only 256x256x3 images. As long as the input image's spatial resolutions are divisible by 64, it's all good.
This is how the authors do it:
In our case, the model is built with
layers.Input((256, 256, 3))
:maxim-tf/create_maxim_model.py
Line 29 in 12df753
If we use
(None, None, 3)
, it throws:From the logs, it might seem obvious that we cannot build the Keras model with
(None, None, 3)
since there are calculations inside the model that require us to specify the spatial dimensions.Do you know of any way to mitigate this problem or any other approach?
@gustheman
The text was updated successfully, but these errors were encountered: