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

Using the estimated models outside of MLWIC2 #15

Open
vmielecnrs opened this issue Sep 17, 2020 · 4 comments
Open

Using the estimated models outside of MLWIC2 #15

vmielecnrs opened this issue Sep 17, 2020 · 4 comments

Comments

@vmielecnrs
Copy link

Hi,

Could it be possible to use the estimated models (I mean, the
model weights, for instance in architecture ResNet-18) outside of MLWIC2, for those of us who prefer Python for instance, or who have their own codes already running?

I would like, for instance, to reuse your estimated models in my codes
implemented in Keras. Do you think it could be possible?

If this require some code development, I can participate in the effort.

@mikeyEcology
Copy link
Owner

The weights are stored in the helper files folder, which you can download from Step 3 in the readme. If you open the species_model folder, you can see the snapshots. These models were trained in tensorflow, so you should be able to load them in Keras.

@vmielecnrs
Copy link
Author

Thanks for the answer. Not easy to do, by the way.

Is your Python code only working with TensorFlow version 1?

pretrained_loader = tf.train.Saver(var_list= self.exclude())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow._api.v2.train' has no attribute 'Saver'


@mikeyEcology
Copy link
Owner

Yes. There are tons of version issues with Tensorflow. You'll need tensorflow 1.14 and python 3.7.

@vmielecnrs
Copy link
Author

It turns out that I get many problems with the "eager mode":

pretrained_loader = tf.train.Saver(tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES))
WARNING: When executing eagerly variables do not necessarily have unique names
tf.train.import_meta_graph("empty_animal/snapshot-110.meta")
RuntimeError:` Exporting/importing meta graphs is not supported when eager execution is enabled.

Does it mean you used the eager mode? And that the network and its weights are not available in the end?

Thanks in advance

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

2 participants