TypeError: _open() got an unexpected keyword argument 'as_gray'
See original GitHub issueDescribe the bug
I pretty much followed the classification tutorial and changed the dataset to my own dataset and I receive an imread
error of similar nature to a very old issue #472
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.6/dist-packages/catalyst/data/dataset.py", line 50, in __getitem__
dict_ = self.open_fn(item)
File "/usr/local/lib/python3.6/dist-packages/catalyst/data/reader.py", line 251, in __call__
for fn in self.readers:
File "/usr/local/lib/python3.6/dist-packages/catalyst/data/reader.py", line 79, in __call__
img = imread(
File "/usr/local/lib/python3.6/dist-packages/catalyst/contrib/utils/image.py", line 73, in imread
# @TODO: add tiff support, currently – jpg and png
File "/usr/local/lib/python3.6/dist-packages/imageio/core/functions.py", line 221, in imread
reader = read(uri, format, "i", **kwargs)
File "/usr/local/lib/python3.6/dist-packages/imageio/core/functions.py", line 143, in get_reader
return format.get_reader(request)
File "/usr/local/lib/python3.6/dist-packages/imageio/core/format.py", line 174, in get_reader
return self.Reader(self, request)
File "/usr/local/lib/python3.6/dist-packages/imageio/core/format.py", line 224, in __init__
self._open(**self.request.kwargs.copy())
TypeError: _open() got an unexpected keyword argument 'as_gray'
To Reproduce I have cloned notebook which should download my dataset here and should replicate the issue.
Expected behavior It should start outputting the Epoch’s Accuracies etc just like example Artist dataset should.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
TypeError: self._open() got an unexpected keyword argument ...
As skimage moved forward in versions, they decided to rename some function argument from as_grey to as_gray .
Read more >TypeError: _open() got an unexpected keyword argument ...
TypeError : _open() got an unexpected keyword argument 'as_grey' As I am new to scikit-image, I am unable to understand what went wrong...
Read more >Python error TypeError encoding is an invalid keyword ...
I have a tine code snippet and it gives me the following error: TypeError: 'encoding' is an invalid keyword argument for this function....
Read more >Solved: Why am I getting error "'newline' is an invalid ke...
Why am I getting error "'newline' is an invalid keyword argument" using the ... with open(FILENAME, 'w', newline='') as csvfile: TypeError: 'newline' is...
Read more >TypeError: uploadFile() got an unexpected keyword argument ...
Problem. Error message: TypeError: uploadFile() got an unexpected keyword argument 'createVersion'. 4.0 - Collaboration and Deployment services ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Scitator I’ve checked all the images using ImageMagick by converting everything to JPG if they weren’t already JPG
@YaLTeR Unfortunately I still get the error in the notebook with that particular change
@lokeshkvn yup,
utils.imread
is mostly focused on typical image formats, like.jpg
,.png
etc. For.tiff
,.gif
- you can try to useutils.mimread
instead 😃 Nevertheless, PR with appropriate docs (that you find clear to use and read) would be really welcome, thanks in advance!