Thursday, July 16, 2020

File read error when using multithreading (workers)

Detectoron2, pythorch 1.5
panda.read_csv() error
"
pandas.errors.ParserError: Error tokenizing data. C error: Calling read(nbytes) on source failed. Try engine='python'.
"

Need to use with to keep file is closed after reading.

Solution

with open(filename) as f:
  df = panda.read_csv(f)