-
Notifications
You must be signed in to change notification settings - Fork 36
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
How can I test the model? #12
Comments
Hi Yangshell, you can run a trained model by setting up an estimator. |
Can I get the image that model predict and real? |
The |
Hello, I use: import tensorflow as tf gqn_model = tf.estimator.Estimator(model_fn=gqn_draw_model_fn, model_dir='/Users/yangshell/Downloads/rooms_ring_debug/gqn_pool_draw2', params=_DEFAULTS) The "result" I get is a generator class, not a dict. What is the mistake in it? |
Hi Yangshell, A few notes on your code to help you get going with this: The If you take a look at the training script, where the
The result of Putting all that together, your code will end up looking something like: from gqn.gqn_model import gqn_draw_model_fn
from gqn.gqn_params import PARAMS
from data_provider.gqn_tfr_provider import gqn_input_fn
MODEL_DIR='/Users/yangshell/Downloads/rooms_ring_debug/gqn_pool_draw2'
DATA_DIR='/tmp/data/gqn-dataset'
DATASET='rooms_ring_camera'
estimator = tf.estimator.Estimator(
model_fn=gqn_draw_model_fn,
model_dir=MODEL_DIR,
params={'gqn_params' : PARAMS, 'debug' : False})
input_fn = lambda mode: gqn_input_fn(
dataset=DATASET,
context_size=PARAMS.CONTEXT_SIZE,
root=DATA_DIR,
mode=mode)
for prediction in estimator.predict(input_fn=input_fn):
# prediction is the dict @ogroth was mentioning
print(prediction['predicted_mean']) # this is probably what you want to look at
print(prediction['predicted_variance']) # or use this to sample a noisy image If you already have a Let us know how this goes. :-) Best, |
Hey Yangshell, |
Can someone provide a clean implementation of how to use the network to predict an image from the test set? It seems like people have got it to work but no one has provided clean code that works now. This would be super helpful. Thanks EDIT: this works |
No description provided.
The text was updated successfully, but these errors were encountered: