gihyo-kaggle's People
gihyo-kaggle's Issues
image_augmentation.py is empty
I tried to read image_augmentation.py. However, it was empty.
Could you please upload correct image_augmentation.py file?
image_augmentation.py does not work
I added list5 which is written in page.49 to image_augmentation.py.
And I updated train_ds in list1 in page.45 accoridng to page.50.
However, the following error is dumped when I run the updated list1.
TypeError Traceback (most recent call last)
<ipython-input-36-620ad43f4a23> in <module>()
4 .shuffle(len(train_dataset), reshuffle_each_iteration=True)
5 .map(lambda image, label: (image_preprocess_with_augment(image), label_preprocess(label)),
----> 6 num_parallel_calls=tf.data.AUTOTUNE)
7 .batch(BATCH_SIZE)
8 .prefetch(8)
10 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py in wrapper(*args, **kwargs)
693 except Exception as e: # pylint:disable=broad-except
694 if hasattr(e, 'ag_error_metadata'):
--> 695 raise e.ag_error_metadata.to_exception(e)
696 else:
697 raise
TypeError: in user code:
<ipython-input-36-620ad43f4a23>:5 None *
lambda image, label: (image_preprocess_with_augment(image), label_preprocess(label)),
<ipython-input-13-d6d29bfe65b7>:16 image_preprocess_with_augment *
image = image_augmentation.augment(image, AUGMENT_N, AUGMENT_M)
/content/drive/My Drive/SoftwareDesign/image_augmentation.py:182 augment *
image = augment_funcs[j](image, M)
/content/drive/My Drive/SoftwareDesign/image_augmentation.py:152 sharpness *
image = tfa.image.sharpness(image, factor)
/usr/local/lib/python3.7/dist-packages/tensorflow_addons/image/color_ops.py:138 sharpness *
image = _sharpness_image(image, factor=factor)
/usr/local/lib/python3.7/dist-packages/tensorflow_addons/image/color_ops.py:101 _sharpness_image *
kernel = tf.tile(kernel, [1, 1, image_channels, 1])
/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/gen_array_ops.py:11532 tile **
"Tile", input=input, multiples=multiples, name=name)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/op_def_library.py:525 _apply_op_helper
raise err
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/op_def_library.py:515 _apply_op_helper
preferred_dtype=default_dtype)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/profiler/trace.py:163 wrapped
return func(*args, **kwargs)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py:1566 convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/constant_op.py:346 _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/constant_op.py:272 constant
allow_broadcast=True)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/constant_op.py:290 _constant_impl
allow_broadcast=allow_broadcast))
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/tensor_util.py:553 make_tensor_proto
"supported type." % (type(values), values))
TypeError: Failed to convert object of type <class 'list'> to Tensor. Contents: [1, 1, None, 1]. Consider casting elements to a supported type.
When I use image_preprocess() instead of image_preprocess_with_augment(), the error was not dumped.
I'm sorry that I don't know why image_preprocess_with_augment() dumps the error.
Could you please tell me the reason and how to fix the issue if possible?
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.