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: Expected 2D array, got 1D array instead: #62

Closed
BianTieyuan opened this issue May 15, 2024 · 30 comments
Closed

ValueError: Expected 2D array, got 1D array instead: #62

BianTieyuan opened this issue May 15, 2024 · 30 comments

Comments

@BianTieyuan
Copy link

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?

@BingqingCheng
Copy link
Owner

I think asap was not able to find the computed descriptors that match the pattern SOAP*.

Can you try:
asap map -f ASAP-desc.xyz -dm '[*]' -c energy pca

@BianTieyuan
Copy link
Author

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.

@BingqingCheng
Copy link
Owner

BingqingCheng commented May 15, 2024 via email

@BingqingCheng
Copy link
Owner

BingqingCheng commented May 15, 2024 via email

@BianTieyuan
Copy link
Author

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
head ASAP-desc.xyz
324 Lattice="19.437355 0.0 0.0 0.0 19.608899 0.0 0.0 0.0 19.294381" Properties=species:S:1:pos:R:3:forces:R:3 virial="22.08496415278571 -11.07622265551594 -11.986055512090692 -11.07622265551594 35.14425376014253 16.63030124008082 -11.986055512090692 16.63030124008082 21.318629140356606" energy=-1506.23162973 SOAP-n4-l3-c3.9-g0.48="0.15065175542723358 0.41413572848936436 0.15442881904569383 0.39635378704700164 1.269596083363615 0.5118619375889054 1.4921384308189525 0.4028366684071485 0.7758510143819413 3.1035910867173286 0.003634057070103129 -0.0066250933568690025 0.026544311019918478 -0.014181185331135493 0.022433551085218148 0.003419745123305451 0.007050167594123492 0.4938056577831395 -0.15188154609397808 0.33010029535562885 0.006441775895658346 -0.013952767567860944 0.02210284893298129 -0.02847077854135643 0.038238163890281944 -0.01578249917668867 0.07025764433710256 0.21774395294409518 -0.05630440073751578 0.6637604329984965 0.00475774675898043 -0.008333583233294287 0.022552685495556456 -0.020739855929913283 0.018612311366640193 -0.021435842905358733 0.039121660368157146 0.19480903064166177 -0.08529378132378014 0.4413009790840278 0.03319205794402811 0.0884136810480686 0.061368320605293805 0.037644259621189835 0.2398197306867688 0.16904873995559397 0.09390317343016366 0.2134160523826052 0.13721401636198025 0.2775739217062056 6.603579629441512e-05 -0.0002739156591809482 0.00012542008254162382 -0.0017320095324621925 0.002460033444293402 0.0030152387663000334 -0.0034497069514447423 0.1106706838917041 0.0659363161445587 0.2894990449137697 0.00012682314586821643 -0.00019710732986006127 0.0017411394704301734 -0.0020117303641952835 0.0015067695608470624 0.004012971145400304 0.005345027400553524 0.07901811374483193 0.03440507991158534 0.2457701569807339 0.00012266372634987008 -0.00017260626395685015 0.001410726920555865 -0.002264794686534974 0.0007061193499517245 0.0010153495339550187 0.005647825258665105 0.040566250384631734 0.006202168909829222 0.17391461604330266 0.06443650163831621 0.17338348278768623 0.08431926869835893 0.0937318088378108 0.5174688645984549 0.2972598638620704 0.3596441867723391 0.35008960838107367 0.42965785320303207 0.7924787888649556 0.001183021052081881 -0.004836283474274908 -0.004087717509448744 -0.017491260448943894 0.026714339123648213 0.049787058939192795 0.08045173146343088 0.21873223708294437 0.1481829783240068 0.4209390222687386 0.001610845081931847 -0.003781278413217762 0.005348820912541725 -0.011929726064927967 0.016762623554133407 0.020468678756127297 0.04790903955537106 0.18103819445490982 0.08242300235638272 0.276048512027836 0.001563577152140688 -0.0029562433804480774 0.007336312479960288 -0.008968264849687073 0.008095413272871468 -0.001705029090411112 0.025631668175063703 0.10605738687789884 0.020091332052973334 0.17512171440268043 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.09803271970121327 0.261393170607818 0.19758068967174877 0.12541096937050897 0.7281164983432776 0.49701615378110237 0.3774888553790882 0.42790507523392257 0.20968051574547794 0.2229767084162806 0.0009080244305422551 -0.0019083420852802145 0.0044340235350913025 -0.004561000481207977 0.004011830871243956 -0.009296572280767352 0.009534006078011322 0.022528133560591256 -0.02413715403626434 0.02691183976846562 0.0009265944516952108 -0.0017566302247691875 0.0037588772041779192 -0.004273397592089731 0.0033310176507897462 -0.007110152884325432 0.008055242414299522 0.01590017844092615 -0.019031492259529405 0.024177207836622614 0.0020087142442710222 -0.0038242651910205365 0.007172372112411881 -0.00807687004150116 0.007281053964987163 -0.013657500552190937 0.015379846540436391 0.02607787663609942 -0.030228145470109984 0.036675700886514916 0.03304681463881189 0.08758698611508779 0.06665850152865246 0.04217056383760473 0.23713776406198941 0.17235119204170235 0.11693791004161876 0.1390804016502791 0.07962827171816224 0.06677258638515125 0.00016645422588714586 -0.0003649000423342814 0.0007503051360085961 -0.0005412040270863524 0.0008480819536872338 -0.001680741474501637 0.0005739029751768039 0.004203287708163459 -0.0021813704753751275 0.009879538441399258 0.000872685865334532 -0.0016642169633457656 0.0030826901754763356 -0.0027153455654166394 0.003186496415015292 -0.0058697594914885924 0.004912901521472577 0.01147271352702262 -0.009078531410248324 0.015629361990533566 0.00044073169737306097 -0.0008396732942388452 0.001484046386558018 -0.0013769983868818687 0.0016033640339236813 -0.002816338184228855 0.002534197124295871 0.005331888458444074 -0.004270787518257197 0.009340517305391415" pbc="T T T" C 3.36076008 4.62705993 2.93737000 -2.44304555 -9.03136253 1.35526976 C 10.54029994 3.07547992 2.35338003 -0.02384790 0.06162597 -0.26169757 C 15.66280007 3.86764002 2.69455003 -0.85709150 -1.23413871 -0.28359857 C 2.39065005 10.37470001 2.13691000 0.20105988 -0.77445762 1.20316864 C 10.28249997 10.26839997 2.70232991 -0.69207662 -2.27570002 0.48650206 C 15.47160005 9.08644005 3.18919004 -0.45333300 1.19713786 -0.34983932 C 2.54553992 16.01369992 3.77300000 1.06474092 0.72640307 -0.59857102 C 9.68334000 16.42149992 2.67514007 0.28889155 -0.15340140 -0.70375203

@BianTieyuan
Copy link
Author

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: > @.***> >

Yes it has multiple frames. It shows 728 frames after loading it into OVITO.

@Ericwang6
Copy link

I am having the same problem...

@BingqingCheng
Copy link
Owner

BingqingCheng commented May 18, 2024 via email

@BianTieyuan
Copy link
Author

test.zip
Here is a .exyz file containing 31 frames. Thanks!

@BingqingCheng
Copy link
Owner

BingqingCheng commented May 19, 2024 via email

@BianTieyuan
Copy link
Author

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.

@BingqingCheng
Copy link
Owner

BingqingCheng commented May 20, 2024 via email

@BianTieyuan
Copy link
Author

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.

@ghyc-1412
Copy link

I have encountered the same problem. Have you solved it?

@BingqingCheng
Copy link
Owner

BingqingCheng commented Jun 14, 2024 via email

@ghyc-1412
Copy link

I can'r reproduce it on my laptop. I think it must be a library issue. What's the ASE version on yours?

ase: 3.22.1 . I tried to use ASE and xdat2xyz.pl to convert the XYZ file, but still reported an error. Using the offline installation version 0.0.1, the error will become indexerror: list index out of range

@tommorowkingzzf
Copy link

have the same error

@BingqingCheng
Copy link
Owner

BingqingCheng commented Jun 27, 2024 via email

@tommorowkingzzf
Copy link

I think this is probably a library issue. I couldn’t reproduce it on my computer. Which version of ase library do you use? Do you use Conda or python virtual environment?

On Thu, Jun 27, 2024 at 5:31 AM tommorowkingzzf @.> wrote: have the same error — Reply to this email directly, view it on GitHub <#62 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABX4HLBKNUCZF3JOL2GND53ZJOBS3AVCNFSM6AAAAABHXJSBZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJTGMYDGNRTGQ . You are receiving this because you commented.Message ID: @.>

thanks reply. The asaplib version is 0.0.1. I install this under a conda environment. Here is the install step : 1. I downloaded the Asap-master.zip from Gitub and unzip this package. 2. conda create -n asap ; 3. source activate asap ; (after this , i have enter my asap environment ) ; 4 . python3 setup.py install . My python version is 3.11. 9.

@tommorowkingzzf
Copy link

After I finished downloading the ASAP, I went to the TiO2-knownphases directory in the example folder and ran the asap gen_desc -f knownphases.xyz -p known-phases-soap soap command with the following error:load xyz file: knownphases.xyz , a total of 16 frames , a total of 282 atoms , with elements: [8, 22] .
Warning: atomic species cross terms are not included! use --crossover if you want cross terms.
{'soap1': {'type': 'SOAP', 'species': [8, 22], 'cutoff': 3.2, 'n': 4, 'l': 3, 'atom_gaussian_width': 0.4}}
Using SOAP Descriptors ...
Using Atomic_2_Global_Average reducer ...
0%| | 0/16 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/home/zzf/anaconda3/envs/asap/bin/asap", line 33, in
sys.exit(load_entry_point('asaplib==0.0.1', 'console_scripts', 'asap')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/cli/cmd_asap.py", line 185, in soap
output_desc(ctx.obj['asapxyz'], ctx.obj['descriptors'], ctx.obj['desc_options']['prefix'], peratom,
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/cli/func_asap.py", line 58, in output_desc
asapxyz.compute_global_descriptors(desc_spec_dict=desc,
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/data/xyz.py", line 281, in compute_global_descriptors
desc_dict_now, atomic_desc_dict_now = global_desc.compute(frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/descriptors/global_descriptors.py", line 107, in compute
global_desc_dict[element], atomic_desc_dict[element] = self.engines[element].create(frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/descriptors/global_descriptors.py", line 200, in create
atomic_desc_dict = self.atomic_desc.compute(frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/descriptors/atomic_descriptors.py", line 96, in compute
element].create(frame)
^^^^^^^^^^^^^
File "/home/zzf/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/descriptors/atomic_descriptors.py", line 168, in create
self.soap = SOAP(species=self.species, rcut=self.cutoff, nmax=self.n, lmax=self.l,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: SOAP.init() got an unexpected keyword argument 'rcut'

@BingqingCheng
Copy link
Owner

Actually it works on my computer (MAC). I used:
1167 conda create -n asap_debug python=3.11
1169 conda activate asap_debug
1170 pip install .
1172 cd examples/TiO2-knownphases
1174 asap gen_desc -f knownphases.xyz -p known-phases-soap soap

@BingqingCheng
Copy link
Owner

I added more libaray version specifications in the setup.py now.

@tommorowkingzzf
Copy link

Actually it works on my computer (MAC). I used: 1167 conda create -n asap_debug python=3.11 1169 conda activate asap_debug 1170 pip install . 1172 cd examples/TiO2-knownphases 1174 asap gen_desc -f knownphases.xyz -p known-phases-soap soap

************ Sorry to bother again, I followed the above steps to reinstall ASAP, and the asap gen_desc command is OK, but after executing the asap map, I get an error of ValueError: Expected 2D array, got 1D array instead, including executing the asap map -f ASAP-desc.xyz -dm '[*]' -c energy pca command

@BingqingCheng
Copy link
Owner

BingqingCheng commented Jun 27, 2024 via email

@BianTieyuan
Copy link
Author

I see. Can you try again after pulling the latest change from the repo? I changed some library settings. Let’s see if that solves it.

On Thu, Jun 27, 2024 at 10:34 AM tommorowkingzzf @.> wrote: Actually it works on my computer (MAC). I used: 1167 conda create -n asap_debug python=3.11 1169 conda activate asap_debug 1170 pip install . 1172 cd examples/TiO2-knownphases 1174 asap gen_desc -f knownphases.xyz -p known-phases-soap soap ************ Sorry to bother again, I followed the above steps to reinstall ASAP, and the asap gen_desc command is OK, but after executing the asap map, I get an error of ValueError: Expected 2D array, got 1D array instead, including executing the asap map -f ASAP-desc.xyz -dm '[]' -c energy pca command — Reply to this email directly, view it on GitHub <#62 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABX4HLFLUXQSZONW75YACPLZJPFBDAVCNFSM6AAAAABHXJSBZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJUGEYDQMZTGE . You are receiving this because you commented.Message ID: @.*>

I tried to clone master branch and install it:
conda create -n asap python=3.11
conda activate asap
git clone -b master https://github.com/BingqingCheng/ASAP.git
cd ASAP && pip install .

Then I used TiO2 example and got error in first step asap gen_desc -f knownphases.xyz -p known-phases-soap soap:

(asap) [polyucmp@localhost TiO2-knownphases]$ asap gen_desc -f knownphases.xyz -p known-phases-soap soap
load xyz file:  knownphases.xyz , a total of  16 frames , a total of  282 atoms , with elements:  [8, 22] .
Warning: atomic species cross terms are not included! use --crossover if you want cross terms.
{'soap1': {'type': 'SOAP', 'species': [8, 22], 'cutoff': 3.2, 'n': 4, 'l': 3, 'atom_gaussian_width': 0.4}}
Using SOAP Descriptors ...
Using Atomic_2_Global_Average reducer ...
  0%|                                                                                                                                  | 0/16 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/bin/asap", line 8, in <module>
    sys.exit(asap())
             ^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/cli/cmd_asap.py", line 185, in soap
    output_desc(ctx.obj['asapxyz'], ctx.obj['descriptors'], ctx.obj['desc_options']['prefix'], peratom,
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/cli/func_asap.py", line 58, in output_desc
    asapxyz.compute_global_descriptors(desc_spec_dict=desc,
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/data/xyz.py", line 285, in compute_global_descriptors
    desc_dict_now, atomic_desc_dict_now = global_desc.compute(frame)
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/descriptors/global_descriptors.py", line 107, in compute
    global_desc_dict[element], atomic_desc_dict[element] = self.engines[element].create(frame)
                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/descriptors/global_descriptors.py", line 200, in create
    atomic_desc_dict = self.atomic_desc.compute(frame)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/descriptors/atomic_descriptors.py", line 96, in compute
    element].create(frame)
             ^^^^^^^^^^^^^
  File "/run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages/asaplib/descriptors/atomic_descriptors.py", line 168, in create
    self.soap = SOAP(species=self.species, rcut=self.cutoff, nmax=self.n, lmax=self.l,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: SOAP.__init__() got an unexpected keyword argument 'rcut'

@BingqingCheng
Copy link
Owner

Strange. This runs on my computer (using the asap_debug conda env).

Your error message suggests that it might be a DScribe lib issue. what is the version of dscribe you have?

I have
dscribe 2.0.1 pypi_0 pypi

(asap_debug) tc@mnbich003 TiO2-knownphases % asap gen_desc -f knownphases.xyz -p known-phases-soap soap
load xyz file: knownphases.xyz , a total of 16 frames , a total of 282 atoms , with elements: [8, 22] .
Warning: atomic species cross terms are not included! use --crossover if you want cross terms.
{'soap1': {'type': 'SOAP', 'species': [8, 22], 'cutoff': 3.2, 'n': 4, 'l': 3, 'atom_gaussian_width': 0.4}}
Using SOAP Descriptors ...
Using Atomic_2_Global_Average reducer ...
100%|██████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:00<00:00, 789.96it/s]

@BianTieyuan
Copy link
Author

Here is my dscribe:

(asap) [polyucmp@localhost TiO2-knownphases]$ pip show dscribe
Name: dscribe
Version: 2.0.1
Summary: A Python package for creating feature transformations in applications of machine learning to materials science.
Home-page: https://singroup.github.io/dscribe/
Author: 
Author-email: 
License: Apache License 2.0
Location: /run/media/polyucmp/282ab895-d12b-4248-8357-261397bf73a6/software/anaconda3/envs/asap/lib/python3.11/site-packages
Requires: ase, joblib, numpy, pybind11, scikit-learn, scipy, sparse
Required-by: asaplib

@BingqingCheng
Copy link
Owner

Ah, okay. So the input format of Dscribe changed. I fixed it now. Please pull and try it out.

@tommorowkingzzf
Copy link

Ah, okay. So the input format of Dscribe changed. I fixed it now. Please pull and try it out.

it is normal, thanks to the developer.

@BianTieyuan
Copy link
Author

It works now. Thanks.

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

5 participants