AA2018-2020
AA2018-2020

Reputation: 431

Python print file name from a Data class

I'm trying to print a filename from a class. The class is defined in here in the below code. The code runs without any issues but it doesn't print the filename, my guess is that i have an issue with calling the class.

I am trying to call the class in another file to print the file name into a CSV during training, and using this code to do this:

filename=CellsDataset(args.data_dir,transform=ToTensor(),return_filenames=True)
print(filename)

Upvotes: 0

Views: 208

Answers (1)

Dennis Sparrow
Dennis Sparrow

Reputation: 978

A CellsDataSet contains a list of filenames in its files attribute, so you can print all of them like this:

filename=CellsDataset(args.data_dir,transform=ToTensor(),return_filenames=True)
print(filename.files)

Upvotes: 1

Related Questions