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
error in Python training.py #2
Comments
Great to hear of your progress.
You said you installed pySerial library. Can you verify that you have the
numpy and scipy libraries also?
My hypothesis is that the code uses the dot product function from
numpy/scipy and uses another version of the dot function if you don't have
those libraries.
…On Fri, Jun 12, 2020 at 3:14 AM mshaub ***@***.***> wrote:
I've finally gotten a working board assembled, tested, and working
(sending serial signals out with ball bounces!) and a projector setup.
I'm running python 2.7.10 and installed the pySerial library and hoped
that was all I needed to proceed. I can get through all the training
bounces for one side, but then get the following error.
Traceback (most recent call last):
File "training.py", line 433, in
[xCoeff1, xCoeff2, xCoeff3, xCoeff4, yCoeff1, yCoeff2, yCoeff3, yCoeff4] =
train(arduino_serial, False)
File "training.py", line 274, in train
xCoeff1 = M1inv * x
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/matrixlib/defmatrix.py",
line 347, in *rmul*
return N.dot(other, self)
ValueError: matrices are not aligned
I printed the matrices (x and M1inv) and they do look quite different. I
would love any help with matrix math and code that's over my head. Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADCMBTW2YG6XFFSWLQRXHTRWFQONANCNFSM4N32UMAA>
.
--
Xiao Xiao, Ph.D.
Postdoctoral Researcher
Laboratoire de Phonétique et Phonologie
Université Sorbonne Nouvelle - Paris 3
Research Affiliate
MIT Media Lab
http://xiaosquared.com
|
I did verify that I have those libraries |
Right, I see now the original error message already refers to numpy.
FYI, in matrix multiplication, it is not necessary for two matrices to be
exactly the same. As long as the # of columns in the first one is the same
as the # of rows in the second one, it's ok.
You said you were able to do the bounces for one side. Have you tried
running the training for just one side at a time? Instead of pressing 'b',
running the training code twice, once for each side. Maybe it
already generated the coefficients for the side you already did, so maybe
just try running it again and specifying the other side?
…On Fri, Jun 12, 2020 at 4:38 PM mshaub ***@***.***> wrote:
I did verify that I have those libraries
Python Version: 2.7.10
Numpy version: 1.8.0rc1
Scipy version: 0.13.0b1
Any other theories about this issue? Would it help if I posted how the
matrices are formatted? like I said they look quite different to me. Thank
you!!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADCMBU6BPBTRW5IXLX2SNDRWIOV3ANCNFSM4N32UMAA>
.
--
Xiao Xiao, Ph.D.
Postdoctoral Researcher
Laboratoire de Phonétique et Phonologie
Université Sorbonne Nouvelle - Paris 3
Research Affiliate
MIT Media Lab
http://xiaosquared.com
|
I tried your suggestion, had to switch to a Windows computer but saw a very similar issue. I tried the training on both sides, then each side separately as you suggested. Please see the errors posted about the "misalignment" of dot products. interesting that it's slightly different between the left and right sides. I really appreciate your help trying to make this work! I have several updates/improvements to share when I'm sure I've got things working, a circuit board design and a processing sketch with the "Corner Pin" library allowing easy alignment of projected image and table. Training Both Sides (b): Training Sides Separately Right Side Only (r): |
@mshaub, are you getting an intermediate file hitdata-left.txt and hitdata-right.txt in the directory where you're running the training? If so, can you share them here? I can't promise a solution, but I think debugging this would require seeing what's getting recorded there. |
hitdata-right.txt
whereas in the last run the error was:
I greatly appreciate any thoughts you have on how I can make this work. I feel like I'm so close! |
Just for due diligence, can you try doing hits the "right way" if you
haven't done so already.
…On Mon, Jun 29, 2020 at 6:01 AM mshaub ***@***.***> wrote:
hitdata-right.txt
<https://github.com/xiaosquared/PingPongPlusPlus/files/4843374/hitdata-right.txt>
hitdata-left.txt
<https://github.com/xiaosquared/PingPongPlusPlus/files/4843375/hitdata-left.txt>
Thanks for your reply @mbernst <https://github.com/mbernst> ! I did get
some files when running the training. I did both sides separately just to
be sure I got a file for each, please see the attached. I didn't follow the
projected pattern when running the training this time, it didn't seem to
matter if the data was "real" so I went quickly dropping the ball close to
where I was sitting. Do let me know if that's a problem, I can certainly
run this again the "right way."
I don't know if it matters, but on both sides today I got this error:
ValueError: shapes (*10,48*) and (100,1) not aligned: *48* (dim 1) != 100
(dim 0)
whereas in the last run the error was:
ValueError: shapes (*10,51*) and (100,1) not aligned: *51* (dim 1) != 100
(dim 0)
I greatly appreciate any thoughts you have on how I can make this work. I
feel like I'm *so* close!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADCMBQNUOFUYJ54K7I7I7DRY7YV3ANCNFSM4N32UMAA>
.
--
Xiao Xiao, Ph.D.
Postdoctoral Researcher
Laboratoire de Phonétique et Phonologie
Université Sorbonne Nouvelle - Paris 3
Research Affiliate
MIT Media Lab
http://xiaosquared.com
|
hello! I've finally gotten my projector setup again and rerun the calibration program the "right way." I'm still getting the same errors but with the "real" data maybe you are more able to see the issues. please see the attached txt files generated despite the errors (I had to do the 2 sides separately). I'm very hopeful you have some suggestions of what I might try next! Thank you so much for your help with this. |
Here is what I think is going on, without having access to a table myself. Looking at training.py, it's clear that you're supposed to get 100 training points out of the exercise, but you're getting fewer, like in the range of 45-55 each time — that's why the shape is, for example, around (10,55) instead of (10,100). It looks like for each of the 20 training points, you do five repetitions (5*20=100). Notice that it calls Then I notice that The most likely cause of all this is that one of your sensors is intermittently malfunctioning. You'd be able to tell if you look at your console the line above any time it prints "none" to the console to see what the raw sensor inputs show. I'm looking at the top of the Line 98 in 117f4c1
|
Awesome! I hope you’re right and it’s just a loose connection or something. I’m away from my ping pong table at the moment but I’ll test and see if any of the sensors are returning “none” as soon as I can. I’ll certainly report back. Thanks for your help and detective work! |
You were right, 2 of my 8 sensors aren’t reporting anything. I swapped the cables with ones that were working and have established that the piezos and wiring is fine so it’s something in the circuit. I can’t see any issue with them, but will try to figure out how to repair them and try this again! |
I've finally gotten a working board assembled, tested, and working (sending serial signals out with ball bounces!) and a projector setup.
I'm running python 2.7.10 and installed the pySerial library and hoped that was all I needed to proceed. I can get through all the training bounces for one side, but then get the following error.
Traceback (most recent call last):
File "training.py", line 433, in
[xCoeff1, xCoeff2, xCoeff3, xCoeff4, yCoeff1, yCoeff2, yCoeff3, yCoeff4] = train(arduino_serial, False)
File "training.py", line 274, in train
xCoeff1 = M1inv * x
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/matrixlib/defmatrix.py", line 347, in rmul
return N.dot(other, self)
ValueError: matrices are not aligned
I printed the matrices (x and M1inv) and they do look quite different. I would love any help with matrix math and code that's over my head. Thanks!
The text was updated successfully, but these errors were encountered: