chenzhik / AnchorFormer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error during train from start

MillyMaMa opened this issue · comments

commented

I run:
CUDA_VISIBLE_DEVICES=2 python3 main.py --config ./cfgs/PCN_models/AnchorFormer.yaml --exp_name train_anchorformer
Error occured:
Traceback (most recent call last):
File "anchorformerutils/registry.py", line 284, in build_from_cfg
return obj_cls(cfg)
File "anchorforme/models/AnchorFormer.py", line 36, in init
self.upsample_net = PointMorphing(self.trans_dim, step = self.up_ratio, hidden_dim = 256) # rebuild a cluster point
TypeError: init() got an unexpected keyword argument 'step'

I change 'step = self.up_ratio' to 'self.up_ratio'
another Error occured:
Traceback (most recent call last):
File "main.py", line 69, in
main()
File "main.py", line 65, in main
run_net(args, config, train_writer, val_writer)
File "anchorformer/tools/runner.py", line 100, in run_net
ret = base_model(partial)
File "/data/.conda/envs/LJJ-PoinTr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/data/.conda/envs/LJJ-PoinTr/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward
return self.module(*inputs[0], **kwargs[0])
File "/data/.conda/envs/LJJ-PoinTr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "anchorformer/models/AnchorFormer.py", line 83, in forward
relative_xyz = self.upsample_net(global_feature, local_feature).reshape(B, M, 3, -1) # B M 3 S
File "/data/.conda/envs/LJJ-PoinTr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "anchorformer/models/Morphing.py", line 190, in forward
num_sample = self.step * self.step
AttributeError: 'PointMorphing' object has no attribute 'step'

This Error occured because you do not give step parameter to init function of class PointMorphing(Morphing.py line 149).
so how to deal with the error.
looking forward to your reply,thanks.

sorrry. you can delete the keyword "step" in this function and try again. LJJ000 @.***> 于2023年6月30日周五 21:22写道:

I run: CUDA_VISIBLE_DEVICES=2 python3 main.py --config ./cfgs/PCN_models/AnchorFormer.yaml --exp_name train_anchorformer Error occured: Traceback (most recent call last): File "anchorformerutils/registry.py", line 284, in build_from_cfg return obj_cls(cfg) File "anchorforme/models/AnchorFormer.py", line 36, in init self.upsample_net = PointMorphing(self.trans_dim, step = self.up_ratio, hidden_dim = 256) # rebuild a cluster point TypeError: init() got an unexpected keyword argument 'step' I change 'step = self.up_ratio' to 'self.up_ratio' another Error occured: Traceback (most recent call last): File "main.py", line 69, in main() File "main.py", line 65, in main run_net(args, config, train_writer, val_writer) File "anchorformer/tools/runner.py", line 100, in run_net ret = base_model(partial) File "/data/.conda/envs/LJJ-PoinTr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/data/.conda/envs/LJJ-PoinTr/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward return self.module(*inputs[0], **kwargs[0]) File "/data/.conda/envs/LJJ-PoinTr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "anchorformer/models/AnchorFormer.py", line 83, in forward relative_xyz = self.upsample_net(global_feature, local_feature).reshape(B, M, 3, -1) # B M 3 S File "/data/.conda/envs/LJJ-PoinTr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "anchorformer/models/Morphing.py", line 190, in forward num_sample = self.step * self.step AttributeError: 'PointMorphing' object has no attribute 'step' This Error occured because you do not give step parameter to init function of class PointMorphing(Morphing.py line 149). so how to deal with the error. looking forward to your reply,thanks. — Reply to this email directly, view it on GitHub <#4>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH2ZMXWTVSVTQ43J7HADOM3XN3HJBANCNFSM6AAAAAAZZ3ESPU . You are receiving this because you are subscribed to this thread.Message ID: @.>

Hi, but your code must use it! following code:
def forward(self, x, q):

    num_sample = self.step * self.step
    bs = x.size(0) 
    seed = self.folding_seed.view(1, 2, num_sample).expand(bs, 2, num_sample).to(x.device) # b 2 n

    adain_deviation = self.mlp_global(x)
    adain_mean = self.mlp_local(q)
    assign_adain_deviations(adain_deviation, self.dec)
    assign_adain_means(adain_mean, self.dec)
    
    fd = self.dec(seed)
    return fd

how to fix it?

commented

We modify the code like this.
image
But when we trained the model from scratch on the PCN dataset, we got this
image
CDL1 is approximately 8.9, which is far from what is reported in the paper 6.59.

@Rogerlv51 @Lujingjing000
Hope you run the code from scratch to see if you can get results close to the paper.

We modify the code like this. image But when we trained the model from scratch on the PCN dataset, we got this image CDL1 is approximately 8.9, which is far from what is reported in the paper 6.59.

@Rogerlv51 @Lujingjing000 Hope you run the code from scratch to see if you can get results close to the paper.

Thanks for your reply! As you said that the CD is not correct, I wonder the inference looks like what? Is the prediction is good or just the same as CDL1 shows? @corecai163

I follow @corecai163 did and I got similar results , as CD with 9.12, I am training from scratch.
Could you provide some help, thanks a lot!

The loss curve may have some problems. You can check the log file.
I retrained my model on PCN and provided the weights for you. @corecai163 @ark1234 @Rogerlv51

Hope this will help.

commented

@chenzhik Thanks. The log file is the same as what is shown in TFBoard. Could you please share your TFBoard Files?