Git Product home page Git Product logo

Comments (11)

xuV2 avatar xuV2 commented on August 10, 2024 1

感谢您的建议,我已经成功解决了我的问题,真的非常感谢您的建议!

from clocs.

pangsu0613 avatar pangsu0613 commented on August 10, 2024

Hello @xuV2 . If one needs to add more channels (or modify the number of channels), these places below need to be modified:
(1)you also need to modify the build_stage2_training function below, add another colum in variable "overlaps".

def build_stage2_training(boxes, query_boxes, criterion, scores_3d, scores_2d, dis_to_lidar_3d,overlaps,tensor_index):

(2)change the hardcoded "4" channels into "5", from line 521-527 (or other number of channels if you want):
overlaps1 = np.zeros((900000,4),dtype=box_2d_preds.detach().cpu().numpy().dtype)

(3)change the hardcoded "4" into "5" in CLOCs model:
nn.Conv2d(4,18,1),

My apology to hardcoded these information. I'll update the repo later to remove these hardcoded value.

from clocs.

xuV2 avatar xuV2 commented on August 10, 2024

Hello! @pangsu0613 First of all, thank you for your prompt reply. But I have changed the code you mentioned, but when the code runs to train.py(line 279) during training, it will still make mistakes.When I delete 279 lines, the code can be trained.
CLOCs/blob/master/second/pytorch/train.py
279 mixed_optimizer.step()

from clocs.

xuV2 avatar xuV2 commented on August 10, 2024

The reason for the error is
RuntimeError: The size of tensor a (4) must match the size of tensor b (5) at non-singleton dimension 1

from clocs.

pangsu0613 avatar pangsu0613 commented on August 10, 2024

mixed_optimizer.step() should not be deleted. Could you show me the whole error message?

from clocs.

xuV2 avatar xuV2 commented on August 10, 2024

Traceback (most recent call last):
File "./pytorch/train.py", line 985, in
fire.Fire()
File "/root/anaconda3/envs/CLOCs/lib/python3.6/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/root/anaconda3/envs/CLOCs/lib/python3.6/site-packages/fire/core.py", line 471, in Fire
target=component.name)
File "/root/anaconda3/envs/CLOCs/lib/python3.6/site-packages/fire/core.py", line 681, in CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "./pytorch/train.py", line 431, in train
raise e
File "./pytorch/train.py", line 336, in train
mixed_optimizer.step() # 这句话有问题 # 通过梯度下降更新参数
File "/root/CLOCs/torchplus/train/fastai_optim.py", line 136, in step
self.opt.step() # 有问题
File "/root/anaconda3/envs/CLOCs/lib/python3.6/site-packages/torch/optim/adam.py", line 93, in step
exp_avg.mul
(beta1).add
(1 - beta1, grad)
RuntimeError: The size of tensor a (4) must match the size of tensor b (5) at non-singleton dimension 1

from clocs.

pangsu0613 avatar pangsu0613 commented on August 10, 2024

did you change the "4" at line 521 and line 524 in voxelnet.py?

from clocs.

xuV2 avatar xuV2 commented on August 10, 2024

iou_test_tensor = iou_test_tensor.reshape(1, 5, 1, 900000) # 原来是4
# print(iou_test_tensor.shape) (1, 5, 1, 900000)
tensor_index_tensor = tensor_index_tensor.reshape(-1, 2)
if max_num == 0:
non_empty_iou_test_tensor = torch.zeros(1, 5, 1, 2)
non_empty_iou_test_tensor[:, :, :, :] = -1
non_empty_tensor_index_tensor = torch.zeros(2, 2)
non_empty_tensor_index_tensor[:, :] = -1
else:
non_empty_iou_test_tensor = iou_test_tensor[:, :, :, :max_num]
# print(non_empty_iou_test_tensor.shape) # torch.Size([1, 5, 1, 313987])
non_empty_tensor_index_tensor = tensor_index_tensor[:max_num, :]

from clocs.

pangsu0613 avatar pangsu0613 commented on August 10, 2024

could you delete all the files in the working directory (including the adam_optimizer-xxxx.tckpt and other files)?

from clocs.

xuV2 avatar xuV2 commented on August 10, 2024

I'm sorry I don't have this ability. I'm just a novice.😭

from clocs.

pangsu0613 avatar pangsu0613 commented on August 10, 2024

when you run training in the terminal:
python ./pytorch/train.py train --config_path=./configs/car.fhd.config --model_dir=/dir/to/your_model_dir
you create a model directory (--model_dir=/dir/to/your_model_dir), just delete everything in that directory.

from clocs.

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.