Traceback (most recent call last):


 "/Users/aktech/anaconda3/envs/distributed-bug/lib/python3.8/site-packages/distributed/protocol/pickle.py", line 49, in dumps

result = pickle.dumps(x, **dump_kwargs)
AttributeError: Can't pickle local object 'foo_does_not_works.<locals>.bar'

Traceback (most recent call last):


 "/usr/local/bin/t2t-trainer", line 33, in <module>

tf.app.run()


 "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 125, in run

_sys.exit(main(argv))


 "/usr/local/bin/t2t-trainer", line 28, in main

t2t_trainer.main(argv)


 "/usr/local/lib/python2.7/dist-packages/tensor2tensor/bin/t2t_trainer.py", line 401, in main

execute_schedule(exp)


 "/usr/local/lib/python2.7/dist-packages/tensor2tensor/bin/t2t_trainer.py", line 356, in execute_schedule

getattr(exp, FLAGS.schedule)()


 "/usr/local/lib/python2.7/dist-packages/tensor2tensor/utils/trainer_lib.py", line 401, in continuous_train_and_eval

self._eval_spec)


 "/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator/training.py", line 471, in train_and_evaluate

return executor.run()


 "/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator/training.py", line 611, in run

return self.run_local()


 "/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator/training.py", line 712, in run_local

saving_listeners=saving_listeners)


 "/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 358, in train

loss = self._train_model(input_fn, hooks, saving_listeners)


 "/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1124, in _train_model

return self._train_model_default(input_fn, hooks, saving_listeners)


 "/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1154, in _train_model_default

features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)


 "/usr/local/lib/python2.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1112, in _call_model_fn

model_fn_results = self._model_fn(features=features, **kwargs)


 "/usr/local/lib/python2.7/dist-packages/tensor2tensor/utils/t2t_model.py", line 1414, in wrapping_model_fn

use_tpu=use_tpu)


 "/usr/local/lib/python2.7/dist-packages/tensor2tensor/utils/t2t_model.py", line 1477, in estimator_model_fn

logits, losses_dict = model(features)
# pylint: disable=not-callable


 "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 530, in __call__

outputs = super(Layer, self).__call__(inputs, *args, **kwargs)


 "/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/engine/base_layer.py", line 554, in __call__

outputs = self.call(inputs, *args, **kwargs)


 "/usr/local/lib/python2.7/dist-packages/tensor2tensor/utils/t2t_model.py", line 323, in call

sharded_logits, losses = self.model_fn_sharded(sharded_features)


 "/usr/local/lib/python2.7/dist-packages/tensor2tensor/utils/t2t_model.py", line 400, in model_fn_sharded

sharded_logits, sharded_losses = dp(self.model_fn, datashard_to_features)


 "/usr/local/lib/python2.7/dist-packages/tensor2tensor/utils/expert_utils.py", line 231, in __call__

outputs.append(fns[i](*my_args[i], **my_kwargs[i]))


 "/usr/local/lib/python2.7/dist-packages/tensor2tensor/utils/t2t_model.py", line 427, in model_fn

body_out = self.body(transformed_features)


 "/usr/local/lib/python2.7/dist-packages/tensor2tensor/models/image_transformer.py", line 50, in body

if (hparams.likelihood == cia.DistributionType.DMOL and
AttributeError: 'HParams' object has no attribute 'likelihood'
