Open lekah opened 3 years ago
Oh, I think this is a version problem. This code was written before Tensorflow 2 IIRC. You could try rolling back (as there may be other underlying issues even if you fix this one).
If you want to try fixing this -- you can remove the self.fast_predict()
stuff. It's a bit of a hack to speed up inference, but I think that in TF2 and Keras 2 you don't actually need it. If you remove that line from the model loading and from when you call predict()
, you should be ok (probably -- I haven't tested it).
You may also be able to get more insight from current group members (@zjensen262?) but IDK if anyone is actively maintaining/updating this code.
Any follow ups on this? I'm getting a different error when I try to load paragraph_classifier.model
with the ParagraphClassifier object. Do y'all know which version of tensorflow/keras this code was written on?
I just added a yml file (https://github.com/olivettigroup/materials-synthesis-generative-models/blob/master/environment.yml) from the conda environment we use. That should give you an idea of what versions of the packages are needed. I tested the paragraph classifier loading with these so let me know if it still doesn't work
Hi, many thanks for open-sourcing code and models, which we want to use to classify a large corpus of papers on synthesis. Could someone could help me out real quick with the following issue? I run
p = paragraph_classifier.ParagraphClassifier() p.load("/home/ubuntu/scratch/models/paragraph_classifier.model")
where the path points to the pre-trained model in https://figshare.com/s/1a07d18ad20008ddd562.
I get the following error message (below). Could the issue be different code version or am I doing something wrong?
Many thanks,
Libraries
Keras==2.4.3 Keras-Preprocessing==1.1.2 tensorflow==2.3.1 tensorflow-cpu==2.3.1 tensorflow-estimator==2.3.0 Python 3.8.6
Traceback
ValueError Traceback (most recent call last)