0

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)
2
  • 1
    Can you share what print(filename) shows Commented Jul 6, 2020 at 14:07
  • <dataset2.CellsDataset object at 0x7ffd771361d0> Commented Jul 6, 2020 at 14:26

1 Answer 1

1

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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.