GithubHelp home page GithubHelp logo

Comments (9)

sayakpaul avatar sayakpaul commented on June 14, 2024 1

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.

sayakpaul avatar sayakpaul commented on June 14, 2024 1

Changes are being done here: #24

from maxim-tf.

gustheman avatar gustheman commented on June 14, 2024

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.

sayakpaul avatar sayakpaul commented on June 14, 2024

Did you try changing the resolution accepted by keras.Input to (None, None, 3)?

This line of code:

inputs = keras.Input((input_resolution, input_resolution, 3))

from maxim-tf.

gustheman avatar gustheman commented on June 14, 2024

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.

gustheman avatar gustheman commented on June 14, 2024

I'll try more tomorrow, I'll ping you when I start

from maxim-tf.

sayakpaul avatar sayakpaul commented on June 14, 2024

Sure. Let me know what you encounter. Maybe attach a Jupyter Notebook?

from maxim-tf.

sayakpaul avatar sayakpaul commented on June 14, 2024

Hacked around this by introducing a dynamic_resize flag to run_eval.py.

from maxim-tf.

danwexler avatar danwexler commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.