how to solve "Unresolved reference 'unpack'" in python3.7?

Question:

when I check the code in kaggle 3hr-tensorrt-nextvit-example, I find there is a error that I can not solve. it is called Unresolved referenceunpack‘.what should I do?

unc_data = unpack(unpack_fmt, cast(bytes, item.LUTData))
Asked By: Hong Cheng

||

Answers:

import the symbol

unpack is probably a symbol you need to import in your file.
If you don’t import it or define yourself a function named unpack, python will tell you with this error. Can you put this on top of your file?

from struct import unpack

The way unpack is called looks like this function is the one from the built-in library.

Answered By: Dorian Turba
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.