Comments (9)
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 run_eval.py
script to show how to do this.
from maxim-tf.
Changes are being done here: #24
from maxim-tf.
I've just tried the create_maxim_model on a new environment and I didn't get this error
can you give me some eval examples for me to test further?
from maxim-tf.
Did you try changing the resolution accepted by keras.Input
to (None, None, 3)
?
This line of code:
maxim-tf/create_maxim_model.py
Line 29 in 12df753
from maxim-tf.
yes, it works
'''
m3 = Model(variant='M-2')
'''
but when I define an input_resolution=512
Traceback (most recent call last):
File "", line 1, in
File "/home/jupyter/maxim-tf/create_maxim_model.py", line 33, in Model
inputs = keras.Input((*input_resolution, 3))
TypeError: 'int' object is not iterable
maybe I'm doing something wrong?
from maxim-tf.
I'll try more tomorrow, I'll ping you when I start
from maxim-tf.
Sure. Let me know what you encounter. Maybe attach a Jupyter Notebook?
from maxim-tf.
Hacked around this by introducing a dynamic_resize
flag to run_eval.py
.
from maxim-tf.
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.
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.
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.
from maxim-tf.
Related Issues (14)
- Implement the architecture in TensorFlow
- Errors during saving the model as a SavedModel resource HOT 3
- Add docstring, citation, and references to the modules
- Obtaining results yourself HOT 1
- Write README
- Port the JAX weights to TensorFlow
- 3D images HOT 1
- MAXIM model pre-trained not working HOT 1
- Finetuning enhancement task HOT 1
- Modularize the notebook
- Create demos
- Modularize the porting utilities
- Test the outputs of the ported TF model and ensure they match with the JAX model HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maxim-tf.