Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

TypeError: 'tuple' object cannot be interpreted as an integer #11

Open
nyadla-sys opened this issue Mar 1, 2022 · 2 comments
Open

TypeError: 'tuple' object cannot be interpreted as an integer #11

nyadla-sys opened this issue Mar 1, 2022 · 2 comments

Comments

@nyadla-sys
Copy link

I created below colab and getting below "TypeError: 'tuple' object cannot be interpreted as an integer" error.
Could you please help me on this ?
https://colab.research.google.com/drive/19JeOkrxlGP6KtkfGbrkO87COc4pvSZSE?usp=sharing#scrollTo=vdeytDxjFdZ3

Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/content/torch2tflite/torch2tflite/converter.py", line 187, in
args.seed
File "/content/torch2tflite/torch2tflite/converter.py", line 40, in init
self.sample_data = self.load_sample_input(sample_file_path, target_shape, seed, normalize)
File "/content/torch2tflite/torch2tflite/converter.py", line 121, in load_sample_input
data = np.random.random(target_shape).astype(np.float32)
File "mtrand.pyx", line 434, in numpy.random.mtrand.RandomState.random
File "mtrand.pyx", line 425, in numpy.random.mtrand.RandomState.random_sample
File "_common.pyx", line 291, in numpy.random._common.double_fill
TypeError: 'tuple' object cannot be interpreted as an integer

@nyadla-sys
Copy link
Author

nyadla-sys commented Mar 3, 2022

@omerferhatt

Please use the below Colab to reproduce the issue
https://colab.research.google.com/drive/1HZgkJRkvuX_6xhceQJGC6TW-zHYhA41a?usp=sharing

@yaserabdelaziz
Copy link

yaserabdelaziz commented Apr 1, 2022

@nyadla-sys change type in this line

parser.add_argument('--target-shape', type=tuple, nargs=3, default=(224, 224, 3))

from tuple to int and run again.

Note: you will need to unzip the installed torch2tflite-1.0.0-py3.8.egg file at your Python site-packages folder using any unzipping tool (e.g. unzip), make the modification above, compress all files again, and put the compressed files in the same path.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants