Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

TF compression fix and UT #2817

Merged
merged 5 commits into from
Aug 24, 2020
Merged

Conversation

liuzhe-lz
Copy link
Contributor

@liuzhe-lz liuzhe-lz commented Aug 24, 2020

tf.keras.Sequential is too tricky to compress, removed from v1.8 release.


class TfCompressorTestCase(TestCase):

def test_layer_detection(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe to skip the tests if tf version is 1.x ? since we have pipelines with tf 1.x installed

@@ -75,6 +78,8 @@ class Compressor:

def __init__(self, LayerWrapperClass, model, config_list):
assert isinstance(model, tf.keras.Model)
if isinstance(model, tf.keras.Sequential):
raise ValueError('NNI model compression does not support `Sequential` model for now')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does not support Sequential?

Copy link
Contributor Author

@liuzhe-lz liuzhe-lz Aug 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's too hard to modify its attributes properly. Sequential abuses complex properties, they are multi-layered, sometimes cached, and sometimes dynamic.

@liuzhe-lz liuzhe-lz changed the base branch from master to v1.8 August 24, 2020 08:05
@ultmaster ultmaster merged commit e6ef08f into microsoft:v1.8 Aug 24, 2020
@liuzhe-lz liuzhe-lz deleted the tf-compress-ut branch September 17, 2020 23:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants