Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError while training the embedding layer #5

Open
ronger-git opened this issue Sep 15, 2020 · 7 comments
Open

ValueError while training the embedding layer #5

ronger-git opened this issue Sep 15, 2020 · 7 comments

Comments

@ronger-git
Copy link

An error occurred while training the embedding layer:ValueError:Dimensions must be equal,but are 702 and 602 for 'sub' with input shapes:[?,?,702],[1,1,602].
2020-09-15 13-55-42屏幕截图
As a beginner, I can’t solve this problem, hope your reply!

@dnguyengithub
Copy link
Collaborator

Hi,
This error happened because you had set the wrong value for the four-hot vector (see create_AIS_dataset in datasets.py).

If you are a beginner, just pull the repository (to update your code), run the code with the default values of the hyperparameters to see how it works.

Good luck!

@ronger-git
Copy link
Author

Thanks for your advice, I will continue to study your code and papers.

@Tata17
Copy link

Tata17 commented Oct 17, 2020

Hi @dnguyengithub I hope this message finds you well.

I already ran your dataset and it worked well after changing things here and there.

For my own dataset, I ran csvtopkl.py, dataset_preprocessing.py, and calculate_AIS_mean (in that order).

Now I am getting this same error. I looked at dataset.py > create_AIS_dataset, and I still don't see what parameters to change that could help me. Could I bother you to elaborate a little bit more on that (on the 4-hot vector values)?

As an aside note:

  • I didn't have the ROT or Nav_STT columns, so I used the following:
    LAT, LON, SOG, COG, HEADING, TIMESTAMP, MMSI, SHIPTYPE = list(range(8))
    I looked for each file that needed this line and changed it to match my data.
    Not sure if that is causing the dimension mismatch, although I don't think it matters for the 4-hot vectors.

Thank you for your time

Screen Shot 2020-10-17 at 12 21 08 AM

@Tata17
Copy link

Tata17 commented Oct 17, 2020

@ronger-git I just realized that you might had solved this issue. Do you have any suggestions?

Best

@dnguyengithub
Copy link
Collaborator

@Tata17 sorry for the late reply.
Your issue relates to the dimension of the 4-hot vector. Did you choose the right values for the 4-hot vector?

@nate-ellis
Copy link

nate-ellis commented Dec 30, 2020

@dnguyengithub I'm interested in this as well. Just finished running the embedding layer and about to preprocess my data. Where exactly do we choose the 4-hot vector in the scripts? As in, with the create_AIS_dataset function is this the setting:
"msg,lat_bins = 300, lon_bins = 300, sog_bins = 30 ,cog_bins = 72"

Also, I have everything but ROT. How much will that impact the output?

Thanks in advance for the assist.

@dnguyengithub
Copy link
Collaborator

@Tata17 @nate-ellis Hello, sorry for taking so long to answer your question, I was busy preparing my thesis defense.
The dimensions of the 4-hot vector are hard-coded (yes, it's bad) in datasets.py, you should change those values.

@nate-ellis You dont need ROT for this version (ROT is used for another version of GeoTrackNet). Only LAT, LON, SOG, COG, MMSI and TIMESTAMP are required in this version.

I will update a better version when I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants