Git Product home page Git Product logo

Comments (3)

hjwang-824 avatar hjwang-824 commented on June 6, 2024

I had train the pix2pix model in your code. Then I want to test the model, and run: python test.py --dataroot ./datasets/test_photo2pants_pix2pix --model pix2pix --name photos2pants_ccp_pix2pix --loadSizeH 240 --loadSizeW 160 --fineSizeH 240 --fineSizeW 160
But it didn't work since it raised the AttributeError again.
dataset [AlignedDataset] was created
initialize network with normal
model [Pix2PixModel] was created
loading the model from ./checkpoints\photos2pants_ccp_pix2pix\latest_net_G.pth
---------- Networks initialized -------------
[Network G] Total number of parameters : 11.383 M

Traceback (most recent call last):
File "test.py", line 29, in
for i, data in enumerate(dataset):
File "D:\MINE\STUDY in SYSU\SmartLLV\Papers\instagan-master\data_init_.py", line 72, in iter
for i, data in enumerate(self.dataloader):
File "D:\devcool\Anaconda2\envs\python36\lib\site-packages\torch\utils\data\dataloader.py", line 286, in next
return self._process_next_batch(batch)
File "D:\devcool\Anaconda2\envs\python36\lib\site-packages\torch\utils\data\dataloader.py", line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
AttributeError: Traceback (most recent call last):
File "D:\devcool\Anaconda2\envs\python36\lib\site-packages\torch\utils\data\dataloader.py", line 57, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "D:\devcool\Anaconda2\envs\python36\lib\site-packages\torch\utils\data\dataloader.py", line 57, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "D:\MINE\STUDY in SYSU\SmartLLV\Papers\instagan-master\data\aligned_dataset.py", line 26, in getitem
assert(self.opt.loadSize >= self.opt.fineSize)
AttributeError: 'Namespace' object has no attribute 'fineSize'

from instagan.

hjwang-824 avatar hjwang-824 commented on June 6, 2024

Since you did't use fineSize and loadSize, I put the photos in the foIder testA and new another empty folder testB, and I choose the option --dataset_mode unaligned,and run:python test.py --dataroot ./datasets/test_photo2pants_pix2pix --model pix2pix --name photos2pants_ccp_pix2pix --loadSizeH 240 --loadSizeW 160 --fineSizeH 240 --fineSizeW 160 --dataset_mode unaligned.

Then here raised another error. It seems the testB can't be empty. However, If I want to test the pix2pix model there is nothing I can put in the testB folder.

dataset [UnalignedDataset] was created
initialize network with normal
model [Pix2PixModel] was created
loading the model from ./checkpoints\photos2pants_ccp_pix2pix\latest_net_G.pth
---------- Networks initialized -------------
[Network G] Total number of parameters : 11.383 M

Traceback (most recent call last):
File "test.py", line 29, in
for i, data in enumerate(dataset):
File "D:\MINE\STUDY in SYSU\SmartLLV\Papers\instagan-master\data_init_.py", line 72, in iter
for i, data in enumerate(self.dataloader):
File "D:\devcool\Anaconda2\envs\python36\lib\site-packages\torch\utils\data\dataloader.py", line 286, in next
return self._process_next_batch(batch)
File "D:\devcool\Anaconda2\envs\python36\lib\site-packages\torch\utils\data\dataloader.py", line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
ZeroDivisionError: Traceback (most recent call last):
File "D:\devcool\Anaconda2\envs\python36\lib\site-packages\torch\utils\data\dataloader.py", line 57, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "D:\devcool\Anaconda2\envs\python36\lib\site-packages\torch\utils\data\dataloader.py", line 57, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "D:\MINE\STUDY in SYSU\SmartLLV\Papers\instagan-master\data\unaligned_dataset.py", line 31, in getitem
index_B = index % self.B_size
ZeroDivisionError: integer division or modulo by zero

from instagan.

sangwoomo avatar sangwoomo commented on June 6, 2024

Yes both testA and testB should not be empty. Since I wanted to change the code minimally, I simply put garbage data in testB and run the model.

from instagan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.