Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'tuple' object has no attribute 'encode' #30

Open
SchrodingerD opened this issue Mar 11, 2024 · 0 comments
Open

'tuple' object has no attribute 'encode' #30

SchrodingerD opened this issue Mar 11, 2024 · 0 comments

Comments

@SchrodingerD
Copy link

Hello!

I tried the file Test.py by using:
test.py --ymlpath=./experiment/singleview2500/d2_singleview2500.yml --gpu=0 --dataroot=./data/LIDC-HDF5-256 --dataset=test --tag=d2_singleview2500 --data=LIDC256 --dataset_class=align_ct_xray_std --model_class=SingleViewCTGAN --datasetfile=./data/test.txt --resultdir=./singleview --check_point=30 --how_many=3

And I always get the error:
File "test.py", line 214, in
evaluate(args)
File "test.py", line 142, in evaluate
for epoch_i, data in tqdm.tqdm(enumerate(dataloader)):
File "/opt/conda/lib/python3.6/site-packages/tqdm/_tqdm.py", line 1022, in iter
for obj in iterable:
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 347, in next
data = self._next_data()
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 973, in _next_data
return self._process_data(data)
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 998, in _process_data
data.reraise()
File "/opt/conda/lib/python3.6/site-packages/torch/_utils.py", line 395, in reraise
raise self.exc_type(msg)
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/gemini/code/XCT/3DGAN/lib/dataset/baseDataSet.py", line 22, in getitem
return self.pull_item(item)
File "/gemini/code/XCT/3DGAN/lib/dataset/alignDataSet.py", line 62, in pull_item
ct_data, x_ray1 = self.load_file(file_path)
File "/gemini/code/XCT/3DGAN/lib/dataset/alignDataSet.py", line 52, in load_file
x_ray1 = np.asarray(hdf5['xray1', 'xray2'])
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/opt/conda/lib/python3.6/site-packages/h5py/_hl/group.py", line 264, in getitem
oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
File "/opt/conda/lib/python3.6/site-packages/h5py/_hl/base.py", line 137, in _e
name = name.encode('ascii')
AttributeError: 'tuple' object has no attribute 'encode'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant