irllabs / ml-lib

A machine learning library for Max and Pure Data
Other
275 stars 40 forks source link

Issue compiling from source #178

Closed dandantsui closed 3 years ago

dandantsui commented 3 years ago

Hi there,

I have to first admit I am not familiar with Visual Studio. I keep running into flext-max_s.lib issues and also unable to compile a x64 version of flext and also "struct alignment must be set to default"

Is there someone who can upload a built Max externals from the current source? I am unable to write the model to the file and need the fixed code. If you could also change the build version so when the external is loaded, Max prints to the console a different version!

Any help is greatly appreciated!

batchku commented 3 years ago

Why not use the ones from the max package manager?

On Tue, May 11, 2021 at 9:15 PM dandantsui @.***> wrote:

Hi there,

I have to first admit I am not familiar with Visual Studio. I keep running into flext-max_s.lib issues and also unable to compile a x64 version of flext.

Is there someone who can upload a built Max externals from the current source? I am unable to write the model to the file and need the fixed code. If you could also change the build version so when the external is loaded, Max prints to the console a different version!

Any help is greatly appreciated!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/irllabs/ml-lib/issues/178, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD6RVCIHAHM4OJ5ZOHPRC3TNH6HPANCNFSM44XXVWEA .

dandantsui commented 3 years ago

@batchku I do use the one from the package manager, however it still has the bug from issue #171 which I need fixed. I need to have the ability to write and read saved data/model.

I see that a PR is merged to #176 and indeed the behaviour is fixed when compiling with Xcode. I just need Windows prebuilt files if someone can compile them.

dandantsui commented 3 years ago

@NiccoloGranieri @batchku I have successfully compiled the RELEASE x64 Max external for Windows. I can confirm WRITE function works but now the READ and CLEAR function crashes Max as soon as I read a SECOND file.

When I comment out mlBase.clear() function in ml_ml.cpp and compile, clear function works fine. I think there is something wrong with mlBase.clear and mlBase.loadModelFromFile()? I also tried mlBase.load() to no avail.

Can you please advise?? This behavior does not exist on Mac and does not crash Max.

dandantsui commented 3 years ago

I have found that if I try to use a bpatcher and remove the bpatcher after loading a preset, Max also crashes. The same behavior exists when after loading a preset and removing the ml.svm object.

There is something truly wrong in ml.lib or the GRT package.

NiccoloGranieri commented 3 years ago

Hi @dandantsui, thanks for the insightful feedback and bug reporting. @jamiebullock and I will try our best to replicate the bugs mentioned above and do a new build this weekend. Unfortunately we've both become increasingly busy in the past 6 months and it is hard to keep up with ml.lib's needs. However, considering that the (write) bug has been already fixed and merged from a PR, we feel like it's important to address these other issues you found and do a new bug-fixing release.

We will keep you posted as soon as we have something.

dandantsui commented 3 years ago

Thanks for the response!

@NiccoloGranieri more updates... discovered that GRT is not at fault. When loading a .data file, I can load as many times as I want. As soon as I try to read the .model file a second time, it crashes. I believe the .model file is written by ml.svm.

Can you please confirm?

NiccoloGranieri commented 3 years ago

Hi @dandantsui, ml.lib 1.1.3 can be now found on the Max Package Manager. I personally tested the build both on macOS and on Windows and can assure you none of the (read), (write) or (clear) bugs are present.

dandantsui commented 3 years ago

@NiccoloGranieri thanks for pushing the new files. I appreciate the help with this!

I just tested this behavior on Windows again and it seems like the same issues are present. It might help if I provide you .data and .model files? I just made these files with the newest ml.lib 1.1.3

Could you please try doing this? (read) new.data & new.model, then after (read) new2.data & new2.model. As soon as I try to (read) new2.model it crashes. If I (read) new.data & new.model then press (clear) it also crashes.

Crash ONLY happens when I read a SECOND dataset, or (clear) from the first dataset.

I've tried loading the files in two different ways. (both result in crash) read "C:/Users/User/Desktop/new.data" read "C:/Users/User/Desktop/new.model"

and also read "C:/Users/User/Desktop/new"

Am I doing anything wrong??

ml_svm_2_datasets.zip

jamiebullock commented 3 years ago

Hi @dandantsui

I have now investigated this, and unfortunately, the problem is occurring due to an upstream bug in GRT. I have reported the issue here. However, I note that there has been no activity on that project for 2 years.

My recommendation would be that you either restart Max between loading models, or use an alternative classifier such as ml.ann.

dandantsui commented 3 years ago

Thankks @jamiebullock for your time. I really appreciate it.