|
由于没有woman和man的图片,随便设置了2个jpg文件夹。随便从网上下载了一些jpg文件。执行random rotate部分代码时报错。报错日志
- WARNING:tensorflow:From D:\environment\Anaconda3\lib\site-packages\tensorflow\python\compat\v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
- Instructions for updating:
- non-resource variables are not supported in the long term
- 2020-12-15 16:55:15.982574: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2
- To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
- 2020-12-15 16:55:15.990829: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x184e09f0860 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
- 2020-12-15 16:55:15.991382: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
- 2020-12-15 16:55:17.098415: W tensorflow/core/framework/op_kernel.cc:1755] Invalid argument: ValueError: buffer source array is read-only
- Traceback (most recent call last):
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\ops\script_ops.py", line 242, in __call__
- return func(device, token, args)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\ops\script_ops.py", line 131, in __call__
- ret = self._func(*args)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 302, in wrapper
- return func(*args, **kwargs)
- File "C:\Users\Z30004~1\AppData\Local\Temp\tmp0efu2bp_.py", line 20, in _rotated
- image_rotated = ag__.converted_call(ag__.ld(transform).warp, (ag__.ld(image), (ag__.ld(tf_shift) + (ag__.ld(tf_rotate) + ag__.ld(tf_shift_inv))).inverse), None, fscope_1)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 461, in converted_call
- return _call_unconverted(f, args, kwargs, options, False)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 340, in _call_unconverted
- return f(*args)
- File "D:\environment\Anaconda3\lib\site-packages\skimage\transform\_warps.py", line 860, in warp
- dims.append(_warp_fast[ctype](image[..., dim], matrix,
- File "skimage\transform\_warps_cy.pyx", line 70, in skimage.transform._warps_cy._warp_fast
- File "stringsource", line 658, in View.MemoryView.memoryview_cwrapper
- File "stringsource", line 349, in View.MemoryView.memoryview.__cinit__
- ValueError: buffer source array is read-only
- loading sample dataset..
- loading sample dataset..
- loading sample dataset..
- Traceback (most recent call last):
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1365, in _do_call
- return fn(*args)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1349, in _run_fn
- return self._call_tf_sessionrun(options, feed_dict, fetch_list,
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1441, in _call_tf_sessionrun
- return tf_session.TF_SessionRun_wrapper(self._session, options, feed_dict,
- tensorflow.python.framework.errors_impl.InvalidArgumentError: ValueError: buffer source array is read-only
- Traceback (most recent call last):
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\ops\script_ops.py", line 242, in __call__
- return func(device, token, args)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\ops\script_ops.py", line 131, in __call__
- ret = self._func(*args)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 302, in wrapper
- return func(*args, **kwargs)
- File "C:\Users\Z30004~1\AppData\Local\Temp\tmp0efu2bp_.py", line 20, in _rotated
- image_rotated = ag__.converted_call(ag__.ld(transform).warp, (ag__.ld(image), (ag__.ld(tf_shift) + (ag__.ld(tf_rotate) + ag__.ld(tf_shift_inv))).inverse), None, fscope_1)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 461, in converted_call
- return _call_unconverted(f, args, kwargs, options, False)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 340, in _call_unconverted
- return f(*args)
- File "D:\environment\Anaconda3\lib\site-packages\skimage\transform\_warps.py", line 860, in warp
- dims.append(_warp_fast[ctype](image[..., dim], matrix,
- File "skimage\transform\_warps_cy.pyx", line 70, in skimage.transform._warps_cy._warp_fast
- File "stringsource", line 658, in View.MemoryView.memoryview_cwrapper
- File "stringsource", line 349, in View.MemoryView.memoryview.__cinit__
- ValueError: buffer source array is read-only
- [[{{node cond/else/_1/cond/EagerPyFunc}}]]
- [[IteratorGetNext_1]]
- During handling of the above exception, another exception occurred:
- Traceback (most recent call last):
- File "D:/book/tf2/TensorFlow2x_Engineering_Implementation-master/code/代码4-10 将图片文件制作成Dataset数据集.py", line 160, in <module>
- value2 = sess.run(one_element2)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 957, in run
- result = self._run(None, fetches, feed_dict, options_ptr,
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1180, in _run
- results = self._do_run(handle, final_targets, final_fetches,
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1358, in _do_run
- return self._do_call(_run_fn, feeds, fetches, targets, options,
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1384, in _do_call
- raise type(e)(node_def, op, message)
- tensorflow.python.framework.errors_impl.InvalidArgumentError: ValueError: buffer source array is read-only
- Traceback (most recent call last):
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\ops\script_ops.py", line 242, in __call__
- return func(device, token, args)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\ops\script_ops.py", line 131, in __call__
- ret = self._func(*args)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 302, in wrapper
- return func(*args, **kwargs)
- File "C:\Users\Z30004~1\AppData\Local\Temp\tmp0efu2bp_.py", line 20, in _rotated
- image_rotated = ag__.converted_call(ag__.ld(transform).warp, (ag__.ld(image), (ag__.ld(tf_shift) + (ag__.ld(tf_rotate) + ag__.ld(tf_shift_inv))).inverse), None, fscope_1)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 461, in converted_call
- return _call_unconverted(f, args, kwargs, options, False)
- File "D:\environment\Anaconda3\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 340, in _call_unconverted
- return f(*args)
- File "D:\environment\Anaconda3\lib\site-packages\skimage\transform\_warps.py", line 860, in warp
- dims.append(_warp_fast[ctype](image[..., dim], matrix,
- File "skimage\transform\_warps_cy.pyx", line 70, in skimage.transform._warps_cy._warp_fast
- File "stringsource", line 658, in View.MemoryView.memoryview_cwrapper
- File "stringsource", line 349, in View.MemoryView.memoryview.__cinit__
- ValueError: buffer source array is read-only
- [[{{node cond/else/_1/cond/EagerPyFunc}}]]
- [[IteratorGetNext_1]]
复制代码
|
|