microsoft / python-language-server

Microsoft Language Server for Python
Apache License 2.0
910 stars 130 forks source link

Server Crash (Pylance) #2162

Closed JOmarCuenca closed 2 years ago

JOmarCuenca commented 2 years ago

Environment data

Expected behaviour

Start the Python server to get linting for numpy and torch during coding.

Actual behaviour

Server crashes 5 times and then stops trying so no linting is being displayed.

Logs

File was exceedingly large, I have attached a file with the full log >> PyServerCrash.log

Here is a Preview of the log.

[Info  - 2:45:56 PM] Analysis cache path: /home/omar/.cache/Microsoft/Python Language Server
[Info  - 2:45:56 PM] Microsoft Python Language Server version 0.5.59.0
[Info  - 2:45:56 PM] Workspace root: /home/omar/Escuela/Cabrera/code
[Info  - 2:45:56 PM] GetCurrentSearchPaths /home/omar/Escuela/Cabrera/code/env/bin/python 
[Info  - 2:45:56 PM] Interpreter search paths:
[Info  - 2:45:56 PM]     /usr/lib/python3.8
[Info  - 2:45:56 PM]     /usr/lib/python3.8/lib-dynload
[Info  - 2:45:56 PM]     /home/omar/Escuela/Cabrera/code/env/lib/python3.8/site-packages
[Info  - 2:45:56 PM] User search paths:
2021-08-15 13:45:57.347758076 [W:onnxruntime:, graph.cc:814 Graph] Initializer embeddings_matrix:0_quantized appears in graph inputs and will not be treated as constant value/weight. This may fail some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.
2021-08-15 13:45:57.347803657 [W:onnxruntime:, graph.cc:814 Graph] Initializer embeddings_matrix:0_scale appears in graph inputs and will not be treated as constant value/weight. This may fail some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.
2021-08-15 13:45:57.347812656 [W:onnxruntime:, graph.cc:814 Graph] Initializer embeddings_matrix:0_zero_point appears in graph inputs and will not be treated as constant value/weight. This may fail some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.
2021-08-15 13:45:57.347819920 [W:onnxruntime:, graph.cc:814 Graph] Initializer fixed_quantization_range_uint8 appears in graph inputs and will not be treated as constant value/weight. This may fail some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.
2021-08-15 13:45:57.347826796 [W:onnxruntime:, graph.cc:814 Graph] Initializer fixed_zero appears in graph inputs and will not be treated as constant value/weight. This may fail some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.

Additional lnformation

I have tried several times with different combinations and different pip packages to check if it helps , regardless of what solution I try, the server still crashes . I do have Pylance installled

Also I have noticed in the output log the recurrence of the message of Stack Overflow every time it crashes

JOmarCuenca commented 2 years ago

Nevermind!

Found the solution in another issue from a couple weeks ago.

Turn out that VSCode doesn't change the default PyServer automatically in your VSCode settings.

For more details read this issue >> Solution