-
Notifications
You must be signed in to change notification settings - Fork 28
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: Expected 2D array, got 1D array instead: #62
Comments
I think asap was not able to find the computed descriptors that match the pattern SOAP*. Can you try: |
Same error occurs: |
Can you check the asapdesc.xyz to see if the descriptors are there?
…On Tue, May 14, 2024 at 8:38 PM BIAN Tieyuan ***@***.***> wrote:
Same error occurs:
ValueError: Expected 2D array, got 1D array instead: array=[]. Reshape
your data either using array.reshape(-1, 1) if your data has a single
feature or array.reshape(1, -1) if it contains a single sample.
—
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABX4HLH777EXEL7LIAHEXWDZCLKCNAVCNFSM6AAAAABHXJSBZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJRGUYTSNJYHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
And does the xyz file contains multiple frames? If it only has one frame it
doesn’t make sense to do pca on global descriptors.
…On Tue, May 14, 2024 at 8:40 PM Bingqing Cheng ***@***.***> wrote:
Can you check the asapdesc.xyz to see if the descriptors are there?
On Tue, May 14, 2024 at 8:38 PM BIAN Tieyuan ***@***.***>
wrote:
> Same error occurs:
> ValueError: Expected 2D array, got 1D array instead: array=[]. Reshape
> your data either using array.reshape(-1, 1) if your data has a single
> feature or array.reshape(1, -1) if it contains a single sample.
>
> —
> Reply to this email directly, view it on GitHub
> <#62 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABX4HLH777EXEL7LIAHEXWDZCLKCNAVCNFSM6AAAAABHXJSBZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJRGUYTSNJYHA>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
I think ASAP.desc.xyz has descriptors part |
Yes it has multiple frames. It shows 728 frames after loading it into OVITO. |
I am having the same problem... |
That's strange. I never had this problem.
Can you send a few frames of your xyz so I can test?
…On Fri, May 17, 2024 at 10:53 PM Yingze Wang ***@***.***> wrote:
I am having the same problem...
—
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABX4HLCJKHILZ5XR54QNFTLZC3UERAVCNFSM6AAAAABHXJSBZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJYGY2TGNRUHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
test.zip |
asap works. I used:
asap map -f ASAP-desc.xyz -dm '[*]' pca
The issue was that if you specify using energy to color the points (-c
energy), but the xyz file doesn't contain energy information, asap raises
an error:
Traceback (most recent call last):
File
"/Users/tc/miniconda3/envs/asap/lib/python3.8/site-packages/asaplib/data/xyz.py",
line 542, in get_property
y_all.append(frame.info[y_key])
KeyError: 'energy'
…On Sun, May 19, 2024 at 12:05 AM Tieyuan BIAN ***@***.***> wrote:
test.zip <https://github.com/BingqingCheng/ASAP/files/15368457/test.zip>
Here is a .exyz file containing 31 frames. Thanks!
—
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABX4HLFVXBHJRONNZVWHLFTZDBFL5AVCNFSM6AAAAABHXJSBZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJZGEZDQMZTGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
It is very strange that I used the same command |
If you remove the single quotation marks, i.e. use
asap map -f ASAP-desc.xyz -dm [*] pca
does it work?
…On Sun, May 19, 2024 at 10:58 PM Tieyuan BIAN ***@***.***> wrote:
It is very strange that I used the same command asap map -f ASAP-desc.xyz
-dm '[*]' pca but still has error
ValueError: Expected 2D array, got 1D array instead: array=[]. Reshape
your data either using array.reshape(-1, 1) if your data has a single
feature or array.reshape(1, -1) if it contains a single sample.
I installed asaplib by pip install asaplib.
—
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABX4HLG7CYP5NQVSNXAOCHLZDGGGVAVCNFSM6AAAAABHXJSBZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJZG4ZDGMRSHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Still same error. I paste the whole error message here: (MDA2) [polyucmp@localhost 282ab895-d12b-4248-8357-261397bf73a6]$ asap map -f ASAP-desc.xyz -dm [*] pca
load xyz file: ASAP-desc.xyz , a total of 31 frames , a total of 10360 atoms , with elements: [1, 6, 7, 53, 82] .
Find the following descriptor names that match the specifications: ['SOAP-n4-l3-c3.9-g0.48']
Cannot find the specified descriptors from xyz
0
Remove raw desciptors..
removing the global descriptors from output xyz with the names: ['SOAP-n4-l3-c3.9-g0.48']
removing the atomic descriptors from output xyz with the names: []
Perform standard scaling of the design matrix. To turn it off use `--no-scale`
Using PCA ...
Start PCA for a design matrix with shape (0,)
Traceback (most recent call last):
File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/MDA2/bin/asap", line 8, in <module>
sys.exit(asap())
...
raise ValueError(msg)
ValueError: Expected 2D array, got 1D array instead:
array=[].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample. |
First I generate descriptors using
asap gen_desc -f train.xyz soap
Then I tried to plot PCA map using
asap map -f ASAP-desc.xyz -dm '[SOAP*]' -c energy pca
. But it raise an error:ValueError: Expected 2D array, got 1D array instead: array=[]. Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
Did I miss something? I noticed that in ./examples/ice-phases there is a file named ice-properties.dat. Should I generate this file?
The text was updated successfully, but these errors were encountered: