diff --git a/tfjs-converter/python/requirements-dev.txt b/tfjs-converter/python/requirements-dev.txt index 39dfdce8faa..7fcbaf740f1 100644 --- a/tfjs-converter/python/requirements-dev.txt +++ b/tfjs-converter/python/requirements-dev.txt @@ -1,3 +1,3 @@ -r requirements.txt pylint==1.9.4; python_version < '3.0' -pylint==2.3.0; python_version > '3.0' +pylint==2.5.0; python_version > '3.0' diff --git a/tfjs-converter/python/tensorflowjs/converters/fold_batch_norms_test.py b/tfjs-converter/python/tensorflowjs/converters/fold_batch_norms_test.py index 30c63edfeca..c641e0abb0c 100644 --- a/tfjs-converter/python/tensorflowjs/converters/fold_batch_norms_test.py +++ b/tfjs-converter/python/tensorflowjs/converters/fold_batch_norms_test.py @@ -225,7 +225,7 @@ def _generate_fused_batchnorm(data_format, conv2d_func, count=1, np.array(inputs), shape=[1, 1, 6, 2] if data_format == "NHWC" else [1, 2, 1, 6], dtype=dtypes.float32) - if conv2d_func == nn_ops.conv2d: + if conv2d_func == nn_ops.conv2d: # pylint: disable=W0143 weights = [1, 2, 3, 4, 0.1, 0.2, 0.3, 0.4] weights_op = constant_op.constant( np.array(weights), shape=[1, 2, 2, 2], dtype=dtypes.float32) diff --git a/tfjs-converter/python/tensorflowjs/converters/keras_h5_conversion.py b/tfjs-converter/python/tensorflowjs/converters/keras_h5_conversion.py index 7a37de2d7b5..f967d47336f 100644 --- a/tfjs-converter/python/tensorflowjs/converters/keras_h5_conversion.py +++ b/tfjs-converter/python/tensorflowjs/converters/keras_h5_conversion.py @@ -66,7 +66,8 @@ def _convert_h5_group(group): group_out = [] if 'weight_names' in group.attrs: # This is a leaf node in namespace (e.g., 'Dense' in 'foo/bar/Dense'). - names = [name for name in group.attrs['weight_names']] + names = group.attrs['weight_names'].tolist() + if not names: return group_out diff --git a/tfjs-converter/python/tensorflowjs/quantization.py b/tfjs-converter/python/tensorflowjs/quantization.py index 11b535334bb..90c1a912408 100644 --- a/tfjs-converter/python/tensorflowjs/quantization.py +++ b/tfjs-converter/python/tensorflowjs/quantization.py @@ -68,7 +68,7 @@ def map_layers_to_quantization_dtype(names, quantization_dtype_map): 'exactly one is supported') fallthrough = dtype_name continue - elif isinstance(patterns, str): + if isinstance(patterns, str): patterns = list([patterns]) # Record matched weights for dtype