-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
number of channels in Conv1d #1
Comments
I also encountered problems when running the code in it. Can I ask you where the pickle file in the code came from? If you can help me, I will be very grateful!
|
Hello Jianming. I wondered the same thing too. I solved it by creating the pickle files myself. The pickle files represent the serialized version of dictionary (dict) objects. Specifically, each of such dict has the image index as keys and a list of three elements as values (img name, img file, img labelvector). For instance, the dictionary for the trainval data would look like this:
And the dictionary for test data would be similar. Therefore, after downloading the dataset, I wrote a script to prepare the pickle version of it. Please, find it attached below.
I hope that helps! |
Hello,Gianluca. |
Dear Jianming, I am happy to have been of help. Regarding your question: from my understanding of the authors' code, I am afraid that the one uploaded by them is a preliminary version of the code. I could not fully reproduce their study, even with the same data. I contacted the authors some time ago, but unfortunately received no reply. Therefore, I started to modify their code myself, mainly based on what was stated in their paper. This required me to implement certain functionalities from scratch. You can find my code in this github repo of mine. This is not fully tested yet, as I am still working on it. If you would like to have a look at it and discuss it there, I'd be glad. Best, |
Dear Gianluca, |
Dear Jianming, thank you very much, drop me an email if you like. Please, use the email address you find in mio bio (https://github.com/gianlucarloni), that is name.surname@isti.cnr.it |
https://github.com/zc2024/Causal_CXR/blob/907e62059b70cead10b9d9dfaf22fa60363a3ecc/lib/models/net.py#L153C13-L153C13
Hi, thank you for your repository. I am facing runtime error while executing this line for the Sequential object:
nn.Conv1d(1, 1, kernel_size=ekernel_size, padding=(ekernel_size - 1) // 2)
the error is
RuntimeError: Expected 2D (unbatched) or 3D (batched) input to conv1d, but got input of size: [1, 2048, 1, 1]
, which suggests that the input tensor at that point in code, say [batch_size, 2048, 14, 14], would need to be flattened along the two last dimensions to properly enter the Conv1d, or just use the Conv2d instead. Is it correct?Also, why do we have 1 input channel and 1 output channel for the Conv1d, and not 2048 channels?
I tried to implement that in the following mode:
self.seq = nn.Sequential( nn.AdaptiveAvgPool2d(1), nn.Flatten(2), nn.Conv1d(2048, 2048, kernel_size=1), nn.Sigmoid(), )
but then the code has new issues on the layernorm in lib/models/transformer.py.
If I am missing something or misinterpreting anything, please let me know. Thank you! Gianluca
The text was updated successfully, but these errors were encountered: