Comments (2)
+1
from compare_gan.
Happening on python 3.6.9 and tf 1.15.0. For some reason any dataset appears as empty.
What worked for me to avoid this error is replacing the train_input_fn here with:
def train_input_fn(self, params=None, preprocess_fn=None):
"""Input function for reading data.
Args:
params: Python dictionary with parameters. Must contain the key
"batch_size". TPUEstimator will set this for you!
preprocess_fn: Function to process single examples. This is allowed to
have a `seed` argument.
Returns:
`tf.data.Dataset` with preprocessed and batched examples.
"""
if params is None:
params = {}
seed = self._get_per_host_random_seed(params.get("context", None))
logging.info("train_input_fn(): params=%s seed=%s", params, seed)
ds = self._load_dataset(split=self._train_split)
# ds = ds.filter(self._train_filter_fn)
ds = ds.repeat()
def one_function(image, label):
images, labels = self._train_transform_fn(image, label, seed=seed)
features = {
"images": images,
"z": np.random.randn(120).astype(np.float32),
}
features["sampled_labels"] = labels
return features, labels
ds = ds.map(one_function)
# ds = ds.map(functools.partial(self._train_transform_fn, seed=seed))
# if preprocess_fn is not None:
# if "seed" in inspect.getargspec(preprocess_fn).args:
# preprocess_fn = functools.partial(preprocess_fn, seed=seed)
# ds = ds.map(one_function)
# Add a feature for the random offset of operations in tpu_random.py.
ds = tpu_random.add_random_offset_to_features(ds)
# ds = ds.shuffle(FLAGS.data_shuffle_buffer_size, seed=seed)
if "batch_size" in params:
ds = ds.batch(params["batch_size"], drop_remainder=True)
return ds.prefetch(tf.contrib.data.AUTOTUNE)
from compare_gan.
Related Issues (20)
- resnet_biggan_deep seems not consist with BigGanDeep in the paper HOT 1
- Is the widening factor of S2GAN's feature extractor really 16? HOT 4
- SSGAN and unsupervised S3GAN are unavailable on tfhub.dev
- Need trainable version for pretrained SSGAN in tfhub HOT 2
- train on GPU HOT 1
- The SSGAN model has no rotation loss in discriminator HOT 1
- Problem about shuffle buffer size for unconditional GAN HOT 1
- issue: ModuleNotFoundError: No module named 'compare_gan' HOT 1
- http error 409 conflict HOT 1
- Error "Retval[7] does not have value" when training SSGAN HOT 3
- celeba_hq dataset was removed?
- SNDCGAN implementation is different from the architecture described in SN paper HOT 1
- Detailed procedure for preprocessing CelebA-HQ 128x128 images HOT 2
- module 'tensorflow' has no attribute 'GraphKeys' HOT 1
- Can I use a custom dataset HOT 1
- Details in the implementation of BigGAN HOT 2
- tf-nightly-gpu version < 2 no longer exists
- Can't run on v3-8 or v3-32 TPU nodes. HOT 7
- Critical error in the implementation of compare_gan vs the official BigGAN model
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 compare_gan.