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

My variable color's are yellow. #6935

Closed
Si-Hyeon-Lee opened this issue Feb 10, 2025 · 3 comments
Closed

My variable color's are yellow. #6935

Si-Hyeon-Lee opened this issue Feb 10, 2025 · 3 comments
Assignees
Labels
duplicate This issue or pull request already exists needs repro Issue has not been reproduced yet

Comments

@Si-Hyeon-Lee
Copy link

Si-Hyeon-Lee commented Feb 10, 2025

Type: Bug

Here is my code. for example,,

import torch.nn as nn
import torch.optim as optim
import torchmetrics
from custom_loss_copy import Kmeans_Supervised_Contrastive_Loss

custom_criterion = Kmeans_Supervised_Contrastive_Loss(10,3,200,device)
criterion = nn.CrossEntropyLoss().to(device) # logits and target
optimizer = optim.Adam(model.parameters(),lr=lr,weight_decay=1e-4) 
#scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=num_epoch)
accuracy_metric = torchmetrics.Accuracy('multiclass',threshold=0.5,num_classes=10).to(device)

custom_criterion , criterion, optimizer , accracy_metric should be bule like color (which is default to 'variable.) but , In my screen. Only 'optimizer' variable is colored blue. Others (custom_criterion, criterion, accuracy_metric) is colored by yellow though there are NOT method or function.

Extension version: 2025.2.1
VS Code version: Code 1.96.4 (cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba, 2025-01-16T00:16:19.038Z)
OS version: Linux x64 6.8.0-52-generic
Modes:

System Added Logs
2025-02-10 20:10:37.661 [info] (Client) Pylance async client (2025.2.1) started with python extension (2025.0.0)
2025-02-10 20:10:37.993 [info] [Info  - 8:10:37 PM] (21071) Server root directory: file:///home/shlee/.vscode/extensions/ms-python.vscode-pylance-2025.2.1/dist
2025-02-10 20:10:38.002 [info] [Info  - 8:10:38 PM] (21071) Pylance language server 2025.2.1 (pyright version 1.1.393, commit 3763156f) starting
2025-02-10 20:10:38.002 [info] [Info  - 8:10:38 PM] (21071) Starting service instance "img_cls"
2025-02-10 20:10:38.026 [info] [Info  - 8:10:38 PM] (21071) Setting environmentName for service "img_cls": "3.10.12 (img_classification venv)"
2025-02-10 20:10:38.026 [info] [Info  - 8:10:38 PM] (21071) Setting pythonPath for service "img_cls": "/home/shlee/Desktop/img_cls/img_classification/bin/python"
2025-02-10 20:10:38.027 [info] [Info  - 8:10:38 PM] (21071) No include entries specified; assuming /home/shlee/Desktop/img_cls
2025-02-10 20:10:38.027 [info] [Info  - 8:10:38 PM] (21071) Auto-excluding **/node_modules
2025-02-10 20:10:38.027 [info] [Info  - 8:10:38 PM] (21071) Auto-excluding **/__pycache__
2025-02-10 20:10:38.027 [info] [Info  - 8:10:38 PM] (21071) Auto-excluding **/.*
2025-02-10 20:10:38.041 [info] [Info  - 8:10:38 PM] (21071) Assuming Python version 3.10.12.final.0
2025-02-10 20:10:38.086 [info] [Info  - 8:10:38 PM] (21071) Auto-excluding /home/shlee/Desktop/img_cls/img_classification
2025-02-10 20:10:38.091 [info] [Info  - 8:10:38 PM] (21071) Found 9 source files
2025-02-10 20:10:38.399 [info] [Info  - 8:10:38 PM] (21071) Background analysis(1) root directory: file:///home/shlee/.vscode/extensions/ms-python.vscode-pylance-2025.2.1/dist
2025-02-10 20:10:38.400 [info] [Info  - 8:10:38 PM] (21071) Background analysis(1) started
2025-02-10 20:10:38.444 [info] [Info  - 8:10:38 PM] (21071) Indexer background runner(2) root directory: file:///home/shlee/.vscode/extensions/ms-python.vscode-pylance-2025.2.1/dist (index)
2025-02-10 20:10:38.444 [info] [Info  - 8:10:38 PM] (21071) Indexing(2) started
2025-02-10 20:10:38.678 [info] [Info  - 8:10:38 PM] (21071) scanned(2) 260 files over 1 exec env
2025-02-10 20:10:38.812 [info] [Info  - 8:10:38 PM] (21071) indexed(2) 260 files over 1 exec env
2025-02-10 20:10:38.883 [info] [Info  - 8:10:38 PM] (21071) Indexing finished(2).
2025-02-10 20:10:54.019 [info] [Error - 8:10:54 PM] Sending notification workspace/didChangeConfiguration failed
2025-02-10 20:10:54.019 [info] Error: Starting server failed
	at P.$start (/home/shlee/.vscode/extensions/ms-python.python-2025.0.0-linux-x64/out/client/extension.js:2:2041277)
	at async P.sendNotification (/home/shlee/.vscode/extensions/ms-python.python-2025.0.0-linux-x64/out/client/extension.js:2:2026526)
2025-02-10 20:10:54.048 [info] [Info  - 8:10:54 PM] Server process exited successfully
2025-02-10 20:11:06.147 [info] [Error - 8:11:06 PM] Server process exited with signal SIGTERM.
2025-02-10 20:11:06.649 [info] (Client) Pylance async client (2025.2.1) started with python extension (2025.0.0)
2025-02-10 20:11:06.972 [info] [Info  - 8:11:06 PM] (21329) Server root directory: file:///home/shlee/.vscode/extensions/ms-python.vscode-pylance-2025.2.1/dist
2025-02-10 20:11:06.972 [info] [Info  - 8:11:06 PM] (21329) Pylance language server 2025.2.1 (pyright version 1.1.393, commit 3763156f) starting
2025-02-10 20:11:06.974 [info] [Info  - 8:11:06 PM] (21329) Starting service instance "img_cls"
2025-02-10 20:11:06.994 [info] [Info  - 8:11:06 PM] (21329) Setting environmentName for service "img_cls": "3.10.12 (img_classification venv)"
2025-02-10 20:11:06.995 [info] [Info  - 8:11:06 PM] (21329) Setting pythonPath for service "img_cls": "/home/shlee/Desktop/img_cls/img_classification/bin/python"
2025-02-10 20:11:06.995 [info] [Info  - 8:11:06 PM] (21329) No include entries specified; assuming /home/shlee/Desktop/img_cls
2025-02-10 20:11:06.995 [info] [Info  - 8:11:06 PM] (21329) Auto-excluding **/node_modules
2025-02-10 20:11:06.995 [info] [Info  - 8:11:06 PM] (21329) Auto-excluding **/__pycache__
2025-02-10 20:11:06.995 [info] [Info  - 8:11:06 PM] (21329) Auto-excluding **/.*
2025-02-10 20:11:07.008 [info] [Info  - 8:11:07 PM] (21329) Assuming Python version 3.10.12.final.0
2025-02-10 20:11:07.047 [info] [Info  - 8:11:07 PM] (21329) Auto-excluding /home/shlee/Desktop/img_cls/img_classification
2025-02-10 20:11:07.054 [info] [Info  - 8:11:07 PM] (21329) Found 9 source files
2025-02-10 20:11:07.363 [info] [Info  - 8:11:07 PM] (21329) Background analysis(1) root directory: file:///home/shlee/.vscode/extensions/ms-python.vscode-pylance-2025.2.1/dist
2025-02-10 20:11:07.365 [info] [Info  - 8:11:07 PM] (21329) Background analysis(1) started
2025-02-10 20:11:07.410 [info] [Info  - 8:11:07 PM] (21329) Indexer background runner(2) root directory: file:///home/shlee/.vscode/extensions/ms-python.vscode-pylance-2025.2.1/dist (index)
2025-02-10 20:11:07.410 [info] [Info  - 8:11:07 PM] (21329) Indexing(2) started
2025-02-10 20:11:07.682 [info] [Info  - 8:11:07 PM] (21329) scanned(2) 260 files over 1 exec env
2025-02-10 20:11:07.810 [info] [Info  - 8:11:07 PM] (21329) indexed(2) 260 files over 1 exec env
2025-02-10 20:11:07.886 [info] [Info  - 8:11:07 PM] (21329) Indexing finished(2).
2025-02-10 20:11:39.915 [info] [Error - 8:11:39 PM] Sending notification workspace/didChangeConfiguration failed
2025-02-10 20:11:39.915 [info] Error: Starting server failed
	at P.$start (/home/shlee/.vscode/extensions/ms-python.python-2025.0.0-linux-x64/out/client/extension.js:2:2041277)
	at async P.sendNotification (/home/shlee/.vscode/extensions/ms-python.python-2025.0.0-linux-x64/out/client/extension.js:2:2026526)
2025-02-10 20:11:39.938 [info] [Info  - 8:11:39 PM] Server process exited successfully
2025-02-10 20:12:10.435 [info] [Error - 8:12:10 PM] Server process exited with signal SIGTERM.
2025-02-10 20:12:10.940 [info] (Client) Pylance async client (2025.2.1) started with python extension (2025.0.0)
2025-02-10 20:12:11.256 [info] [Info  - 8:12:11 PM] (21376) Server root directory: file:///home/shlee/.vscode/extensions/ms-python.vscode-pylance-2025.2.1/dist
2025-02-10 20:12:11.257 [info] [Info  - 8:12:11 PM] (21376) Pylance language server 2025.2.1 (pyright version 1.1.393, commit 3763156f) starting
2025-02-10 20:12:11.259 [info] [Info  - 8:12:11 PM] (21376) Starting service instance "img_cls"
2025-02-10 20:12:11.276 [info] [Info  - 8:12:11 PM] (21376) Setting environmentName for service "img_cls": "3.10.12 (img_classification venv)"
2025-02-10 20:12:11.276 [info] [Info  - 8:12:11 PM] (21376) Setting pythonPath for service "img_cls": "/home/shlee/Desktop/img_cls/img_classification/bin/python"
2025-02-10 20:12:11.276 [info] [Info  - 8:12:11 PM] (21376) No include entries specified; assuming /home/shlee/Desktop/img_cls
2025-02-10 20:12:11.276 [info] [Info  - 8:12:11 PM] (21376) Auto-excluding **/node_modules
2025-02-10 20:12:11.276 [info] [Info  - 8:12:11 PM] (21376) Auto-excluding **/__pycache__
2025-02-10 20:12:11.276 [info] [Info  - 8:12:11 PM] (21376) Auto-excluding **/.*
2025-02-10 20:12:11.288 [info] [Info  - 8:12:11 PM] (21376) Assuming Python version 3.10.12.final.0
2025-02-10 20:12:11.330 [info] [Info  - 8:12:11 PM] (21376) Auto-excluding /home/shlee/Desktop/img_cls/img_classification
2025-02-10 20:12:11.335 [info] [Info  - 8:12:11 PM] (21376) Found 9 source files
2025-02-10 20:12:11.639 [info] [Info  - 8:12:11 PM] (21376) Background analysis(1) root directory: file:///home/shlee/.vscode/extensions/ms-python.vscode-pylance-2025.2.1/dist
2025-02-10 20:12:11.640 [info] [Info  - 8:12:11 PM] (21376) Background analysis(1) started
2025-02-10 20:12:11.674 [info] [Info  - 8:12:11 PM] (21376) Indexer background runner(2) root directory: file:///home/shlee/.vscode/extensions/ms-python.vscode-pylance-2025.2.1/dist (index)
2025-02-10 20:12:11.674 [info] [Info  - 8:12:11 PM] (21376) Indexing(2) started
2025-02-10 20:12:11.939 [info] [Info  - 8:12:11 PM] (21376) scanned(2) 260 files over 1 exec env
2025-02-10 20:12:12.083 [info] [Info  - 8:12:12 PM] (21376) indexed(2) 260 files over 1 exec env
2025-02-10 20:12:12.153 [info] [Info  - 8:12:12 PM] (21376) Indexing finished(2).

System Info
Item Value
CPUs AMD Ryzen 9 7900X 12-Core Processor (24 x 5438)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 0, 0, 0
Memory (System) 61.95GB (55.00GB free)
Process Argv --crash-reporter-id 2acfebf9-2beb-49bc-82b3-0ee3ef084170
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc1:31192215
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624
9064b325:31222308
copilot_t_ci:31222730
jda6j935:31233686

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Feb 10, 2025
@Si-Hyeon-Lee
Copy link
Author

Image

@debonte
Copy link
Contributor

debonte commented Feb 10, 2025

Duplicate of #6924, I think? I'll submit a PR for that today.

@KacieKK KacieKK added the duplicate This issue or pull request already exists label Feb 10, 2025
@debonte
Copy link
Contributor

debonte commented Feb 11, 2025

I confirmed that criterion and accuracy_metric being yellow is a dupe of #6924. The CrossEntropyLoss and Metric types inherit a __call__ method from Module, so a recent change we made is causing them both to be semantically colored as functions. I'm not sure where Kmeans_Supervised_Contrastive_Loss is defined, but I'm assuming it has the same issue.

Resolving as a dupe. I'm working on a fix for #6924.

@debonte debonte closed this as completed Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants