When I try to run the DCGAN, I get the following error. Do you see what's incorrect?
THE Configuration of your experiment ..
{'agent': 'DCGANAgent',
'async_loading': True,
'batch_size': 64,
'beta1': 0.5,
'beta2': 0.999,
'checkpoint_file': 'checkpoint.pth.tar',
'cuda': True,
'data_folder': './data/celeba',
'data_loader': 'CelebADataLoader',
'data_loader_workers': 2,
'data_mode': 'imgs',
'exp_name': 'dcgan_exp_0',
'g_input_size': 100,
'gpu_device': 0,
'image_size': 64,
'input_channels': 3,
'learning_rate': 0.0002,
'max_epoch': 1,
'mode': 'train',
'num_classes': 2,
'num_filt_d': 64,
'num_filt_g': 64,
'pin_memory': True,
'relu_slope': 0.2,
'seed': 12345,
'validate_every': 2,
'weight_decay': 0,
'x_test': '',
'x_train': '',
'x_valid': '',
'y_test': '',
'y_train': '',
'y_valid': ''}
***************************************
The experiment name is dcgan_exp_0
***************************************
[INFO]: Hi, This is root.
[INFO]: After the configurations are successfully processed and dirs are created.
[INFO]: The pipeline of the project will begin now.
--- Logging error ---
Traceback (most recent call last):
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 993, in emit
msg = self.format(record)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 839, in format
return fmt.format(record)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 576, in format
record.message = record.getMessage()
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "main.py", line 38, in <module>
main()
File "main.py", line 32, in main
agent = agent_class(config)
File "/home/$USER/pytorch/agents/dcgan.py", line 65, in __init__
self.logger.info ("seed: " , self.manual_seed)
Message: 'seed: '
Arguments: (3744,)
--- Logging error ---
Traceback (most recent call last):
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/handlers.py", line 71, in emit
if self.shouldRollover(record):
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/handlers.py", line 187, in shouldRollover
msg = "%s\n" % self.format(record)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 839, in format
return fmt.format(record)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 576, in format
record.message = record.getMessage()
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/logging/__init__.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "main.py", line 38, in <module>
main()
File "main.py", line 32, in main
agent = agent_class(config)
File "/home/$USER/pytorch/agents/dcgan.py", line 65, in __init__
self.logger.info ("seed: " , self.manual_seed)
Message: 'seed: '
Arguments: (3744,)
[INFO]: Program will run on *****CPU*****
[INFO]: Loading checkpoint 'experiments/dcgan_exp_0/checkpoints/checkpoint.pth.tar'
[INFO]: No checkpoint exists from 'experiments/dcgan_exp_0/checkpoints/'. Skipping...
[INFO]: **First time to train**
epoch-0-: 0%| | 0/3166 [00:00<?, ?it/s]/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/nn/functional.py:1594: UserWarning: Using a target size (torch.Size([64])) that is different to the input size (torch.Size([5120])) is deprecated. Please ensure they have the same size.
"Please ensure they have the same size.".format(target.size(), input.size()))
Exception ignored in: <bound method _DataLoaderIter.__del__ of <torch.utils.data.dataloader._DataLoaderIter object at 0x7f13e317d710>>
Traceback (most recent call last):
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 399, in __del__
self._shutdown_workers()
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 378, in _shutdown_workers
self.worker_result_queue.get()
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/queues.py", line 337, in get
return _ForkingPickler.loads(res)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/multiprocessing/reductions.py", line 151, in rebuild_storage_fd
fd = df.detach()
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/resource_sharer.py", line 57, in detach
with _resource_sharer.get_connection(self._id) as conn:
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/resource_sharer.py", line 87, in get_connection
c = Client(address, authkey=process.current_process().authkey)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/connection.py", line 493, in Client
answer_challenge(c, authkey)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/connection.py", line 737, in answer_challenge
response = connection.recv_bytes(256) # reject large message
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/connection.py", line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/connection.py", line 407, in _recv_bytes
buf = self._recv(4)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/multiprocessing/connection.py", line 379, in _recv
chunk = read(handle, remaining)
ConnectionResetError: [Errno 104] Connection reset by peer
Traceback (most recent call last):
File "main.py", line 38, in <module>
main()
File "main.py", line 33, in main
agent.run()
File "/home/$USER/pytorch/agents/dcgan.py", line 133, in run
self.train()
File "/home/$USER/pytorch/agents/dcgan.py", line 141, in train
self.train_one_epoch()
File "/home/$USER/pytorch/agents/dcgan.py", line 175, in train_one_epoch
loss_D_real = self.loss(D_real_out, y)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "/home/$USER/pytorch/graphs/losses/bce.py", line 15, in forward
loss = self.loss(logits, labels)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 486, in forward
return F.binary_cross_entropy(input, target, weight=self.weight, reduction=self.reduction)
File "/home/$USER/anaconda3/envs/torch/lib/python3.6/site-packages/torch/nn/functional.py", line 1597, in binary_cross_entropy
"!= input nelement ({})".format(target.nelement(), input.nelement()))
ValueError: Target and input must have the same number of elements. target nelement (64) != input nelement (5120)