Comments (4)
I think the newer releases are compatible with tf-1.13.
from keras-radam.
Thank you for your updating! Worked fine with the demo code. Still I got the error when I was trying to replace Adam with RAdam() with following code:
model.compile(
loss='categorical_crossentropy',
# optimizer=tf.keras.optimizers.Adam(lr=0.001),
optimizer=RAdam(),
metrics=['accuracy'],)
model.fit(X, labels, batch_size=batch_size, epochs=epochs, callbacks=[early_stop,scheduler])
Please find the error message below:
Traceback (most recent call last):
File "classifier.py", line 95, in <module>
classfier.pre_train()
File "classifier.py", line 79, in pre_train
self.train_source_classifier(source_)
File "classifier.py", line 74, in train_source_classifier
model.fit(X, labels, batch_size=batch_size, epochs=epochs, callbacks=[early_stop,scheduler])
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 880, in fit
validation_steps=validation_steps)
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_arrays.py", line 195, in model_iteration
f = _make_execution_function(model, mode)
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_arrays.py", line 122, in _make_execution_function
return model._make_execution_function(mode)
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1983, in _make_execution_function
self._make_fit_function()
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1926, in _make_fit_function
'_fit_function', [self.total_loss] + metrics_tensors)
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1895, in _make_train_function_helper
params=self._collected_trainable_weights, loss=self.total_loss)
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/optimizer_v2.py", line 379, in get_updates
return [self.apply_gradients(grads_and_vars)]
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/optimizer_v2.py", line 364, in apply_gradients
update_ops.append(update_grad_to_var(grad, var))
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/optimizer_v2.py", line 351, in update_grad_to_var
grad.values, var, grad.indices)
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/optimizer_v2.py", line 693, in _resource_apply_sparse_duplicate_indices
return self._resource_apply_sparse(summed_grad, handle, unique_indices)
File "/home/flydsc/.local/lib/python3.6/site-packages/keras_radam/optimizer_v2.py", line 180, in _resource_apply_sparse
m_t = self._resource_scatter_add(m, indices, m_scaled_g_values)
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/optimizer_v2.py", line 415, in __getattribute__
raise e
File "/home/flydsc/.local/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/optimizer_v2.py", line 405, in __getattribute__
return super(OptimizerV2, self).__getattribute__(name)
AttributeError: 'RAdam' object has no attribute '_resource_scatter_add'
maybe I should follow some rules to do the replacement?
Any thoughts or ideas are appraciated.
from keras-radam.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from keras-radam.
I have the same issue here AttributeError: 'RAdam' object has no attribute '_resource_scatter_add'. how can I resolve it?
from keras-radam.
Related Issues (20)
- not compatable with tf 1.8 , AttributeError: 'RAdamOptimizer' object has no attribute '_call_if_callable' HOT 6
- ModuleNotFoundError: No module named 'tensorflow.python.keras.optimizer_v2' HOT 1
- epsilon not compatible with Adam HOT 1
- Could not interpret optimizer identifier HOT 3
- Issue about the dtype HOT 3
- Ranger Optimizer extension HOT 2
- amsgrad parameter HOT 3
- Maintenance HOT 1
- Generate First Release HOT 1
- TF.keras
- Very slow implementation HOT 1
- TypeError: Unexpected keyword argument passed to optimizer: lr HOT 1
- AttributeError: 'TFOptimizer' object has no attribute 'learning_rate' HOT 7
- Any other parameter needed when warmup? HOT 1
- Warmup causes NAN HOT 1
- ValueError: An operation has `None` for gradient. Please make sure that all of your ops have a gradient defined (i.e. are differentiable). Common ops without gradient: K.argmax, K.round, K.eval. HOT 1
- How can i use radam in tf1.4? HOT 1
- No module name math_ops HOT 2
- ModuleNotFoundError: No module named 'keras.legacy' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras-radam.