Comments (5)
Are you using the new TPUEstimator? Do you have a copy of the tutorial you can share that has this problem?
from adanet.
In simple_dnn.py, I added two lines of codes to output the iteration_step:
def build_subnetwork_train_op(self, subnetwork, loss, var_list, labels,
iteration_step, summary, previous_ensemble):
"""See adanet.subnetwork.Builder."""
with tf.name_scope(""): # output iteration_step
summary.scalar("iteration_step", iteration_step)
#NOTE: The adanet.Estimator increments the global step.
update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
with tf.control_dependencies(update_ops):
return self._optimizer.minimize(loss=loss, var_list=var_list)
In the Customizing AdaNet example, I modified the input_fn function:
def input_fn(partition, training, batch_size):
"""Generate an input_fn for the Estimator."""
def _input_fn():
if partition == "train":
dataset = tf.data.Dataset.from_generator(
generator(x_train, y_train), (tf.float32, tf.int32), ((28, 28), ()))
else:
dataset = tf.data.Dataset.from_generator(
generator(x_test, y_test), (tf.float32, tf.int32), ((28, 28), ()))
# We call repeat after shuffling, rather than before, to prevent separate
# epochs from blending together.
if training:
dataset = dataset.shuffle(10 * batch_size, seed=RANDOM_SEED).repeat()
dataset = dataset.map(preprocess_image).batch(batch_size)
return dataset.repeat()
return _input_fn
Also, argument train_distribution was explicitly specified in configuration for estimator:
devices = ["/device:GPU:0", "/device:GPU:1"]
distribution = tf.contrib.distribute.MirroredStrategy(devices=devices)
config = tf.estimator.RunConfig(
save_checkpoints_steps=50000,
save_summary_steps=50000,
train_distribute=distribution,
tf_random_seed=RANDOM_SEED)
No other changes were made. Thanks in advance.
from adanet.
Are you using the new TPUEstimator? Do you have a copy of the tutorial you can share that has this problem?
In simple_dnn.py, I added two lines of codes to output the iteration_step:
def build_subnetwork_train_op(self, subnetwork, loss, var_list, labels,
iteration_step, summary, previous_ensemble):
"""See adanet.subnetwork.Builder."""
with tf.name_scope(""): # output iteration_step
summary.scalar("iteration_step", iteration_step)
#NOTE: The adanet.Estimator increments the global step.
update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
with tf.control_dependencies(update_ops):
return self._optimizer.minimize(loss=loss, var_list=var_list)
In the Customizing AdaNet example, I modified the input_fn function:
def input_fn(partition, training, batch_size):
"""Generate an input_fn for the Estimator."""
def _input_fn():
if partition == "train":
dataset = tf.data.Dataset.from_generator(
generator(x_train, y_train), (tf.float32, tf.int32), ((28, 28), ()))
else:
dataset = tf.data.Dataset.from_generator(
generator(x_test, y_test), (tf.float32, tf.int32), ((28, 28), ()))
# We call repeat after shuffling, rather than before, to prevent separate
# epochs from blending together.
if training:
dataset = dataset.shuffle(10 * batch_size, seed=RANDOM_SEED).repeat()
dataset = dataset.map(preprocess_image).batch(batch_size)
return dataset.repeat()
return _input_fn
Also, argument train_distribution was explicitly specified in configuration for estimator:
devices = ["/device:GPU:0", "/device:GPU:1"]
distribution = tf.contrib.distribute.MirroredStrategy(devices=devices)
config = tf.estimator.RunConfig(
save_checkpoints_steps=50000,
save_summary_steps=50000,
train_distribute=distribution,
tf_random_seed=RANDOM_SEED)
No other changes were made. Thanks in advance.
from adanet.
I see you are using tf.contrib.distribute.MirroredStrategy(devices=devices)
. I wonder if that could be the issue. I'll have a look.
from adanet.
All methods of Summary should add an argument , collections=None
.
https://github.com/tensorflow/adanet/blob/master/adanet/core/summary.py#L38
from adanet.
Related Issues (20)
- `input_fn` called multiple times in `Estimator.train` HOT 5
- relation to AutoML tables in GCP HOT 2
- Question regarding architecture HOT 3
- adanet.ensemble.Ensembler not used in Tutorials? HOT 5
- Adding different loss to tf.estimator.Head HOT 2
- Correct place to add custom metric_fn? HOT 3
- Early stopping 'best-practice' using Adanet
- Interpretation of serialized "architecture_summary" HOT 2
- simple_dnn should not work !
- [Bug] AutoEnsembleEstimator() cannot be instatiated if tf< 2.x HOT 1
- I am having errors and do not know what to do... HOT 1
- Evaluation issue using TPUEstimator HOT 2
- RuntimeError with adanet_tpu tutorial using TF2.2 and Adanet 0.9.0
- AttributeError: module 'adanet' has no attribute 'AutoEnsembleEstimator'
- Is there any code to compute FLOPs and parameter size of adanet?
- Error on running tutorial notebook in Google colab
- Using AdaNet ModelFlow with pre-trained models HOT 1
- Got `AttributeError: 'NoneType' object has no attribute 'logits'` error while applying tutorial
- Is this repository deprecated? HOT 1
- Design suggestions of _IterationBuilder._best_loss from adanet.core.iteration
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 adanet.