Closed ZC0015wqj closed 1 year ago
Hi,
No, this repo does not contain the code to pre-train a model on ImageNet. Please prepare your own code to pre-train the encoder. PyTorch official has a minimal example code. Please feel free to have a look at it.
Thank you very much for your help, may I take the liberty to ask you, can you share this part of the training code
Hi, the pre-training code needs some cleaning up, but I have no time to do it. I am not going to include it in this repo as it is not that relevant. I can give you the code in a few days if you send me an email.
Thank you very much, can you give me your email
I sent an email, I'm not sure if you received it
Yes, I received your email. I will send you the code in a few days.
Thank you very much!!!!!!!!!!
Hello, how can I set the parameters to train the optimal model without the ImageNet pre-training model?
Hello, how can I set the parameters to train the optimal model without the ImageNet pre-training model?
If you do not want to use the ImageNet pre-training you can simply not set --mypretrain
.
Hello, how can I set the parameters to train the optimal model without the ImageNet pre-trained model? At the same time, I still have a problem. When I use the command 'tensorboard --log_dir ./tmp/mytrain' to check the log, I found that in a certain part, it has achieved higher accuracy and lower accuracy than the final training result. Error, but when I evaluate all the generated weights, I find that the accuracy of these models is far worse than what I see in the log, can you please tell me why?
Hello, how can I set the parameters to train the optimal model without the ImageNet pre-training model?
If you do not want to use the ImageNet pre-training you can simply not set
--mypretrain
.
This means that I don't need to modify other parameters, just don't add this option, right?
Hello, how can I set the parameters to train the optimal model without the ImageNet pre-training model?
If you do not want to use the ImageNet pre-training you can simply not set
--mypretrain
.This means that I don't need to modify other parameters, just don't add this option, right?
yes.
Hello, how can I set the parameters to train the optimal model without the ImageNet pre-trained model? At the same time, I still have a problem. When I use the command 'tensorboard --log_dir ./tmp/mytrain' to check the log, I found that in a certain part, it has achieved higher accuracy and lower accuracy than the final training result. Error, but when I evaluate all the generated weights, I find that the accuracy of these models is far worse than what I see in the log, can you please tell me why?
Please see the comments here.
Hello, how can I set the parameters to train the optimal model without the ImageNet pre-trained model? At the same time, I still have a problem. When I use the command 'tensorboard --log_dir ./tmp/mytrain' to check the log, I found that in a certain part, it has achieved higher accuracy and lower accuracy than the final training result. Error, but when I evaluate all the generated weights, I find that the accuracy of these models is far worse than what I see in the log, can you please tell me why?
Please see the comments here.
Well, when I found out that there is a big difference between them, I thought I could get a good result, now my result is not very ideal
"The final training result", do you mean the last epoch? If so, please check the results of all the epochs, you might get the best result at earlier epoch.
Yes, it's strange that when I checked all epochs, I didn't find a better value
I sent an email, I'm not sure if you received it
I have sent you the code.
I sent an email, I'm not sure if you received it
I have sent you the code.
Thank you very much!
Could you please provide your complete training code for reference? When I used the code you sent to the email for training, I encountered a problem similar to the one in the picture. I don’t know how to solve it, so I would like to take the liberty of asking a copy of your complete training code is ok
Hi, the output of the encoder should be a single tensor (the classification result). I already gave you a hint in the code return self.norm(x.mean([-2, -1])) # Global average pooling, (N, C, H, W) -> (N, C)
please check if the dimension of your output is NxC
.
can you help me solve this problem
Traceback (most recent call last):
File "nain.py", line 502, in
Hi, I'm not able to help you because you modified the code and I don't know what forward_featiresx
is. It seems to be a simple feature channel misalignment problem.
您好,我无法帮助您,因为您修改了代码,但我不知道是什么
forward_featiresx
。这似乎是一个简单的特征通道错位问题。
When I added depth_encoder to the lite_mono_pretrain code for training, it prompted me that the depth_encoder output is a 3D list type when calculating the loss, but the given target is a tensor type with a size of 128. May I ask how you unify the output of depth_encoder with the target?
can you print the shapes of the output and the tensor before self.norm(x.mean([-2, -1]))
of your depth_encoder?
(N, C, H, W) -> (N, C)
I don't really understand that the output of the encoding layer should be a list structure as shown in the figure. We don't seem to be able to change its dimension directly through torch.mean (N, C, H, W) -> (N, C), do you need to convert the list to Tensor type?
You should keep the output as a tensor, not a list. If the output of your network is x = (N,C,H,W)
, here the C is 1000 because you have 1000 classes. Then you use self.norm(x.mean([-2, -1]))
, and you can get a tensor of dimension (N, C)
. It's not a list!
网络的输出不是三个不同阶段的特征图吗
您应该将输出保留为张量,而不是列表。如果网络的输出为
x = (N,C,H,W)
,则此处 C 为 1000,因为您有 1000 个类。然后使用self.norm(x.mean([-2, -1]))
,就可以得到一个维度的张量(N, C)
。这不是一个清单!
不是的,当中阶段的特征是用于之后级联到decoder上面的,但是你这里是为了预训练一个分类encoder,因此你只应该输出最后一个结果。
Can such two structures directly make losses? If we do it directly, we will encounter problems. Is this correct?
No. You cannot compute the loss with nan
.
When the sample
passes the model
, its type becomes this
There must be some errors in your network. My pre-training code has been shared with several people and they have no such problems.
This is the shape when the encoding layer is output, but there is a problem during pre-training
There must be some errors in your network. My pre-training code has been shared with several people and they have no such problems.
这个跟输入的H,W有关吗
No. The main.py
defines the image size for training. parser.add_argument('--input_size', default=256, type=int, help='image input size')
否。它
main.py
定义了训练的图像大小。parser.add_argument('--input_size', default=256, type=int, help='image input size')
When calculating theloss
, the value ofNAN
appeared again, and now the output of the encoding layer is normal
Do you have this layer after getting your x
?
self.head = nn.Linear(dims[-2], num_classes)
x = self.head(x)
拿到手后有这一层吗
x
?self.head = nn.Linear(dims[-2], num_classes)
`x = self.head(x) Yes, this structure exists
Have you solved this problem?
I'm now closing this issue because I haven't heard back from you. Please reopen it or create a new one if you have further questions.
Hello, thank you for your help to me before, but I still want to ask how to pre-train on the ImageNet-1K dataset. It is the same as the kitti_data dataset training method, modify the file path in eigen_zhou, and then follow Is it ok to train with the command given. I have downloaded the ImageNet-1K dataset now, thank you very much for your help