Skip to content

Encounter a runtime error when trying to run train_stg1.py #7

@C-H-Chien

Description

@C-H-Chien

Hi, I am very new to this repo and when I tried to run train_stg1.py, the following runtime error occurs and I am a bit puzzled of the reason why:

======= TRAINING START =======
Epoch 0:
Traceback (most recent call last):
File "../train_stg1.py", line 45, in
hist = trainer.train(model, optimizer, scheduler)
File "/pytorch-3d-point-cloud-generation/trainer.py", line 31, in train
train_epoch_loss = self._train_on_epoch(model, optimizer)
File "/pytorch-3d-point-cloud-generation/trainer.py", line 76, in _train_on_epoch
XYZ, maskLogit = model(input_images)
File "/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/pytorch-3d-point-cloud-generation/PCGModel.py", line 123, in forward
latent = self.encoder(x)
File "/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/pytorch-3d-point-cloud-generation/PCGModel.py", line 66, in forward
x = self.fc1(x.view(-1, 4096))
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

In addition, the user is required to create a logs folder under scripts folder such that a log file can be created automatically before training. I suggest including this information in the README.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions