snap-stanford / ViRel

ViRel: Unsupervised Visual Relations Discovery with Graph-level Analogy
http://snap.stanford.edu/virel/
8 stars 4 forks source link

where is var edge_matrix_comp #3

Open zdx3578 opened 3 months ago

zdx3578 commented 3 months ago

0 conda env create -f environment.yml ; this env so hard to create

github codespace ubuntu 20.04.6 LTS,conda python 3.7.16 just run;

1 File "/workspaces/ViRel/args.py", line 142, in standardize_args if not args.max_count: AttributeError: 'Namespace' object has no attribute 'max_count'

fix by run args; python relation_analogy.py --yaml config/main3.yaml

2 def get_root_dir(): dirname = os.getcwd()

dirname_split = dirname.split("/")

#index = dirname_split.index("reasoning")
#dirname = "/".join(dirname_split[:index + 1])
return dirname

3 relation_analogy.py add one line code. " from BabyARC.code.dataset.objects import Object"

zdx3578 commented 3 months ago

python3.9 env pip req.txt error:

Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try pip install --use-pep517.

zdx3578 commented 3 months ago

req3.txt req2.txt

参考命令: 470 conda install cudatoolkit=11.3 -c pytorch -c conda-forge 477 conda install cudatoolkit=11.3 -c pytorch -c conda-forge 478 pip install torch-scatter==2.0.8 480 conda install pytorch-scatter -c pyg 481 conda install torch-scatter -c pyg 482 pip install torch-scatter==2.0.8 483 pip install torch-sparse==0.6.12 484 pip install torch-sparse

mkdir -p /dfs/user/tailin/.results/Datasets/ 561 mkdir ../cache 562 mkdir cache mkdir concept_env/datasets -p

zdx3578 commented 3 months ago

Epoch: 9 T-dur 18.74 T-loss 3.430 T-acc 0.000 V-dur 0.00 V-loss 0.000 V-acc 0.000 Traceback (most recent call last): File "/home/zdx/miniconda3/envs/py37virel/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/zdx/miniconda3/envs/py37virel/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/zdx/.vscode-server/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/main.py", line 39, in cli.main() File "/home/zdx/.vscode-server/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main run() File "/home/zdx/.vscode-server/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file runpy.run_path(target, run_name="main") File "/home/zdx/.vscode-server/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 322, in run_path pkg_name=pkg_name, script_name=fname) File "/home/zdx/.vscode-server/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 136, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/home/zdx/.vscode-server/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code exec(code, run_globals) File "/home/zdx/github/VSAHDC/virel/relation_analogy.py", line 802, in main() File "/home/zdx/github/VSAHDC/virel/relation_analogy.py", line 119, in main val_dur, protos, accTr, accVal, taskAccTr, taskAccVal, edgeDistTrStr, edgeDistValStr = evaluate(val_loader, train_loader_edge, val_loader_edge, edge_configs, model, task_loss_fn, epoch, start_step, writer, data_record, args, device, args.padding_objs, args.total_tasks) File "/home/zdx/github/VSAHDC/virel/relation_analogy.py", line 268, in evaluate relTaskDistTr, taskDistTr, relDistTr, protos, labelsTr, edgeMaskTr, taskIdsTr = edge_dist_fast(train_loader_edge, model, args, device, False, protos=protos) File "/home/zdx/github/VSAHDC/virel/relation_analogy.py", line 524, in edge_dist_fast uniq_edges_comp, counts = torch.unique(edge_matrix_comp, return_counts=True, dim=0) NameError: name 'edge_matrix_comp' is not defined (py37virel) ➜ VSAHDC