Closed alexdauenhauer closed 3 years ago
train_dataset = tf.data.Dataset.from_generator(
lambda: train_datagen.flow_from_directory(train_dir),
output_types=(tf.float32, tf.float32),
output_shapes=([None, 256, 256, 3], [None, 2]))
switching to a lambda function solved it, but seems like I shouldn't have to do that
[x] Check that you are up-to-date with the master branch of keras-preprocessing. You can update with:
pip install git+git://github.com/keras-team/keras-preprocessing.git --upgrade --no-deps
[x] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short). https://gist.github.com/alexdauenhauer/1f0ee72e602eb02674141774f7de9750
I am following the guidelines from the tensorflow documentation as well as I can tell for creating a tf.data.Dataset from a generator.
When I call
model.fit
I get this errorLooking online and many people are saying upgrading to TF 2.1 fixed this, but I am running 2.2.
Current Environment
It seems that the filename is being interpreted as bytes instead of a string so then
endswith
is expecting bytes?