TypeError: an integer is required (got type is tuple)

tags: python  

TypeError: an integer is required (got type is tuple), This error. To understand it literally, you need to obtain a integer data, and the original code is the tuple.

What needs to be done is to change the wrong specific line, just change the tuples to integer. My side is

img_tr = [transforms.RandomResizedCrop((int(args.image_size), int(args.image_size)), (args.min_scale, args.max_scale))]

(Int (ARGS.Image_size), int (args.image_size)) can be changed to int (args.image_size). I guess that due to the problem of the version, the usage has changed. The original version only supports the integer and the new version of the new version supports integer and meta -group.

Change it as follows:

img_tr = [transforms.RandomResizedCrop(int(args.image_size), (args.min_scale, args.max_scale))]

This type of error is the same, Typeerror: Anxxx is required (got type is yyy )

Intelligent Recommendation

TypeError: an integer is required (got type str)

This is type alone What is needed is an int type, but input is a STR type  ...

pyInstaller packaged into exe and TypeError: an integer is required (got type bytes) solution

pyinstaller installation Commonly used PyInstaller packaging command parameters are as follows: F: Package Python program as a single executable file D: Package the Python program as a folder i: gener...

Pyspark: TypeError: An Integer is Required (got type bytes) resolved

Linux [Ubuntu, other versions are for reference only] Run the Pyspark program in Jupyter Notebook error, query information discovery, current2020.11.18Pyspark still does not support higher version of ...

Python socket TypeError: an integer is required (got type str)

Python Socket TypeError: an integer is required (got type str) You can see that the Python prompts to connect, and the error isan integer is required (got type str) Then I saw my code. It is only nece...

More Recommendation

TypeError: an integer is required (got type bytes) error correction method of seeking correction

TypeError: an integer is required (got type bytes) error correction method of seeking correction Traceback (most recent call last): File “F:/python/automatic/tsTserv.py”, line 18, in tcpCl...

python: Use PyInstaller packaged into exe files, and TypeError: an integer is required (got type bytes) exception resolution

python: Use PyInstaller packaged into exe files, and TypeError: an integer is required (got type bytes) exception resolution 2019-11-12 15:50:22 lad. Read the article tag number 225: python package ex...

Python: Use PyInstaller to package into an exe file, and TypeError: an integer is required (got type bytes) exception resolution

Using Python 3.6 or above to use pyinstaller for packaging will result in a TypeError: an integer is required (got type bytes) exception. The solution and installation pyinstaller tutorial are as foll...

"TypeError: an integer is required (got type bytes)" error when trying to run pyspark after installing spark 2.4.4

The environment is Ubuntu, jdk8, spark-2.4.5-bin-hadoop2.7, python3.8.2 1. Reason Since spark does not yet support python3.8 2. Solution So just downgrade python, I downgrade to python3.6.9 successful...

Pycharm: Error TypeError: an integer is required (got type bytes) after setting Anaconda

Background: After installing the latest version of Anaconda 3.9, after setting Python Interpreter in Pycharm to python.exe under the latest version of Anaconda file, the console fails to start and an ...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top