rgsachin / cove Goto Github PK
View Code? Open in Web Editor NEWKeras implementation of CoVe
License: BSD 3-Clause "New" or "Revised" License
Keras implementation of CoVe
License: BSD 3-Clause "New" or "Revised" License
How can we use the output from tf.nn.embedding_lookup() in Tensorflow as the input to the cove_model.predict method?
Hi,
not able to load tensorflow model.
ValueError: bad marshal data (unknown type code)
How can I fix this?
After doing:
from keras.models import load_model
cove_model = load_model('Keras_CoVe.h5')
I get:
---------------------------------------------------------------------------
SystemError Traceback (most recent call last)
<ipython-input-16-c8371c8a91f2> in <module>()
1 from keras.models import load_model
----> 2 cove_model = load_model('/Users/mikko/Downloads/Keras_CoVe.h5')
~/miniconda3/envs/wip_conda/lib/python3.6/site-packages/keras/engine/saving.py in load_model(filepath, custom_objects, compile)
417 f = h5dict(filepath, 'r')
418 try:
--> 419 model = _deserialize_model(f, custom_objects, compile)
420 finally:
421 if opened_new_file:
~/miniconda3/envs/wip_conda/lib/python3.6/site-packages/keras/engine/saving.py in _deserialize_model(f, custom_objects, compile)
223 raise ValueError('No model found in config.')
224 model_config = json.loads(model_config.decode('utf-8'))
--> 225 model = model_from_config(model_config, custom_objects=custom_objects)
226 model_weights_group = f['model_weights']
227
~/miniconda3/envs/wip_conda/lib/python3.6/site-packages/keras/engine/saving.py in model_from_config(config, custom_objects)
456 '`Sequential.from_config(config)`?')
457 from ..layers import deserialize
--> 458 return deserialize(config, custom_objects=custom_objects)
459
460
~/miniconda3/envs/wip_conda/lib/python3.6/site-packages/keras/layers/__init__.py in deserialize(config, custom_objects)
53 module_objects=globs,
54 custom_objects=custom_objects,
---> 55 printable_module_name='layer')
~/miniconda3/envs/wip_conda/lib/python3.6/site-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
143 config['config'],
144 custom_objects=dict(list(_GLOBAL_CUSTOM_OBJECTS.items()) +
--> 145 list(custom_objects.items())))
146 with CustomObjectScope(custom_objects):
147 return cls.from_config(config['config'])
~/miniconda3/envs/wip_conda/lib/python3.6/site-packages/keras/engine/network.py in from_config(cls, config, custom_objects)
1030 if layer in unprocessed_nodes:
1031 for node_data in unprocessed_nodes.pop(layer):
-> 1032 process_node(layer, node_data)
1033
1034 name = config.get('name')
~/miniconda3/envs/wip_conda/lib/python3.6/site-packages/keras/engine/network.py in process_node(layer, node_data)
989 # and building the layer if needed.
990 if input_tensors:
--> 991 layer(unpack_singleton(input_tensors), **kwargs)
992
993 def process_layer(layer_data):
~/miniconda3/envs/wip_conda/lib/python3.6/site-packages/keras/engine/base_layer.py in __call__(self, inputs, **kwargs)
455 # Actually call the layer,
456 # collecting output(s), mask(s), and shape(s).
--> 457 output = self.call(inputs, **kwargs)
458 output_mask = self.compute_mask(inputs, previous_mask)
459
~/miniconda3/envs/wip_conda/lib/python3.6/site-packages/keras/layers/core.py in call(self, inputs, mask)
685 if has_arg(self.function, 'mask'):
686 arguments['mask'] = mask
--> 687 return self.function(inputs, **arguments)
688
689 def compute_mask(self, inputs, mask=None):
~/miniconda3/envs/wip_conda/lib/python3.6/site-packages/keras/layers/core.py in <lambda>(x)
SystemError: unknown opcode
The Keras weights do not work on python 3.6 (with correct keras and tensorflow versions) rather only on 3.5. Could you provide a new model weight file for cove for python 3.6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.