IGDN
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python, tensorflow
- Domain
- machine-learning
Research direction
Start by running the provided generatorend reproduction and compare saving with Conv2D versus Conv2DTranspose. Read tensorflow_compression/python/layers/gdn.py around GDN.call, especially the alpha and rectify condition; done means the model saves without the OperatorNotAllowedInGraphError while preserving the reported layer behavior.
Written by the indexing model from the issue text.
Description
class generatorend(tf.keras.Model):
def __init__(self):
super().__init__(name="generator_ender")
self.conv1 = tf.keras.layers.Conv2D(480, kernel_size = [3,3], strides =[2,2],activation=tfc.GDN(inverse = True,name="gdn1"))
self.conv2 = tf.keras.layers.Conv2DTranspose(480, kernel_size = [3,3], strides =[2,2],activation=tfc.GDN(inverse = True, name="gdn1"))
self.acti = tf.keras.layers.Activation(tf.keras.activations.tanh)
def call(self, inputs):
x = self.conv1(inputs)
x = self.conv2(x)
x = self.acti(x)
return x`
model = generatorend()
dummy_input = tf.random.normal([1, 16,24, 8])
model(dummy_input) # This will build the model
model.save('test_model') # Now try to save it
`
Traceback (most recent call last):
File "test.py", line 399, in
model.save('test_model') # Now try to save it
File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/usr/lib/python3.8/contextlib.py", line 120, in exit
next(self.gen)
File "/usr/local/lib/python3.8/dist-packages/tensorflow_compression/python/layers/gdn.py", line 381, in call
if not callable(self.alpha_parameter) and self.alpha == 1 and self.rectify:
tensorflow.python.framework.errors_impl.OperatorNotAllowedInGraphError: Exception encountered when calling layer 'gdn1' (type GDN).
Using a symbolic tf.Tensor as a Python bool is not allowed: AutoGraph did convert this function. This might indicate you are trying to use an unsupported feature.
Call arguments received by layer 'gdn1' (type GDN):
• args=('tf.Tensor(shape=(None, None, None, 480), dtype=float32)',)
• kwargs=<class 'inspect._empty'>`
tested with simple code:
however, encountered with :
It is clear that all params stays the same and the only difference is conv2d and conv2dTranspose. Thus i think it may be a bug
- Dominant language
- Python
- Stars
- 923
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tensorflow/compression
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
tensorflow/compression#188 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tensorflow/compression#187 ·
-
安卓 Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
tensorflow/compression#185 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
tensorflow/compression#179 · 4 reactions ·
-
Unable to save model Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
tensorflow/compression#174 · 1 reaction ·
All issues in tensorflow/compression
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·