cetinsamet / zero-shot-learning Goto Github PK
View Code? Open in Web Editor NEWImplementation of Zero-Shot Learning algorithm using Word2Vecs as class embeddings
License: MIT License
Implementation of Zero-Shot Learning algorithm using Word2Vecs as class embeddings
License: MIT License
line 182 in train.py
out = model.layers[-1].output
->
out = model.layers[-2].output
HI @cetinsamet , Can you please tell us from where you got the data and created a .pkl file from that .
Thanks for sharing your code.
I get the next error trying to run the train.py file:
TypeError: custom_kernel_init() got an unexpected keyword argument 'dtype'
Any hint?
Kind regards,
When I was trying to run train.py, I got this exception. Please help me:
C:\Users\omurhan.soysal\Anaconda3\envs\py38\python.exe C:/Users/omurhan.soysal/Documents/Development/Python/workspace/zero-shot-learning-cetinsamet/src/train.py
-> data loading is completed.
2021-03-24 22:40:39.445695: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "C:/Users/omurhan.soysal/Documents/Development/Python/workspace/zero-shot-learning-cetinsamet/src/train.py", line 226, in
main()
File "C:/Users/omurhan.soysal/Documents/Development/Python/workspace/zero-shot-learning-cetinsamet/src/train.py", line 177, in main
model = build_model()
File "C:/Users/omurhan.soysal/Documents/Development/Python/workspace/zero-shot-learning-cetinsamet/src/train.py", line 128, in build_model
model.add(Dense(NUM_CLASS, activation='softmax', trainable=False, kernel_initializer=custom_kernel_init))
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\training\tracking\base.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\keras\engine\sequential.py", line 221, in add
output_tensor = layer(self.outputs[0])
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 925, in call
return self._functional_construction_call(inputs, args, kwargs,
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1098, in _functional_construction_call
self._maybe_build(inputs)
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 2643, in _maybe_build
self.build(input_shapes) # pylint:disable=not-callable
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\keras\layers\core.py", line 1171, in build
self.kernel = self.add_weight(
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 597, in add_weight
variable = self._add_variable_with_custom_getter(
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\training\tracking\base.py", line 745, in _add_variable_with_custom_getter
new_variable = getter(
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\keras\engine\base_layer_utils.py", line 133, in make_variable
return tf_variables.VariableV1(
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\ops\variables.py", line 260, in call
return cls._variable_v1_call(*args, **kwargs)
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\ops\variables.py", line 206, in _variable_v1_call
return previous_getter(
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\ops\variables.py", line 199, in
previous_getter = lambda **kwargs: default_variable_creator(None, **kwargs)
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 2583, in default_variable_creator
return resource_variable_ops.ResourceVariable(
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\ops\variables.py", line 264, in call
return super(VariableMetaclass, cls).call(*args, **kwargs)
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\ops\resource_variable_ops.py", line 1507, in init
self._init_from_args(
File "C:\Users\omurhan.soysal\Anaconda3\envs\py38\lib\site-packages\tensorflow\python\ops\resource_variable_ops.py", line 1651, in _init_from_args
initial_value() if init_from_fn else initial_value,
TypeError: custom_kernel_init() got an unexpected keyword argument 'dtype'
Hi, thank you for your code.
Could you please tell me, is this code able to train my own dataset?
How to get the .npy and .pkl files?
Thanks!
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.