yoeo / guesslang

Detect the programming language of a source code
https://guesslang.readthedocs.io
MIT License
773 stars 110 forks source link

Bug: illegal hardware instruction #51

Closed jonatan5524 closed 2 years ago

jonatan5524 commented 2 years ago

I have installed the package as instructed from the documentation with pip, and later tried from source code, run the example mentioned in the README:

echo '
package main
import "fmt"

func main() {
    fmt.Println("My mascot is a gopher and Google loves me. Who am I?")
}

' | guesslang

and getting this error:

[1]    836098 done                                        echo  |
       836099 illegal hardware instruction (core dumped)  guesslang

also tried in python instead of the command line and got the same error.

Pip Version: pip 20.0.2 Python version: python 3.8.10 OS: Ubuntu 20.04.3 LTS

yoeo commented 2 years ago

Hello @jonatan5524,

Sad to see that it crashes on your device. Guesslang uses Tensorflow and here is what I found about the Tensorflow's "illegal hardware instruction" error:

Yes, if your CPU does not support AVX (the likely cause for Illegal instruction (core dumped) error) then you need to compile from source. This causes the code to be generated without AVX instructions and then you can use it.

https://github.com/tensorflow/tensorflow/issues/17411#issuecomment-608027554

jonatan5524 commented 2 years ago

Thank you for the response, Maybe I will try to compile Tensorflow from source as mentioned and then use the tool.