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

Unable to reconstruct mesh from a custom dataset #1

Closed
yo6snap opened this issue Jan 14, 2022 · 2 comments
Closed

Unable to reconstruct mesh from a custom dataset #1

yo6snap opened this issue Jan 14, 2022 · 2 comments

Comments

@yo6snap
Copy link

yo6snap commented Jan 14, 2022

I'm trying to reconstruct a mesh from a custom dataset by using the following command:
$ python run.py -i -c configs/custom.yaml

When has_label attribute is 0 inside custom.yaml file the following exception is raised:

READ CONFIG FROM  configs/custom.yaml
SAVE CONFIG TO  /home/p/src/dgnn/data/models/kf96/config.yaml

######## START INFERENCE OF 1 FILES ########

LOAD MODEL /home/p/src/dgnn/data/models/kf96/model_best.ptm

  0%|                       | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/opt/anaconda3/envs/dgnn/lib/python3.9/site-packages/munch/__init__.py", line 103, in __getattr__    
    return object.__getattribute__(self, k)
AttributeError: 'Munch' object has no attribute 'results'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/anaconda3/envs/dgnn/lib/python3.9/site-packages/munch/__init__.py", line 106, in __getattr__
    return self[k]
KeyError: 'results'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/p/src/dgnn/run.py", line 321, in <module>
    inference(clf)
  File "/home/p/src/dgnn/run.py", line 173, in inference
    prediction = trainer.inference(data, subgraph_sampler, clf)
  File "/home/p/src/dgnn/learning/runModel.py", line 414, in inference
    clf.results.OA_test = 0.0
  File "/opt/anaconda3/envs/dgnn/lib/python3.9/site-packages/munch/__init__.py", line 108, in __getattr__
    raise AttributeError(k)
AttributeError: results

It seems results is never assigned.
Replacing results by results_df triggers another exception.
Usage of results is done when has_label attribute is 0:

    if(clf.inference.has_label):
        clf.inference.metrics = Metrics()
        data_inference.batch_x = data_inference.x
        data_inference.batch_gt = data_inference.y

        self.calcLossAndOA(logits_cell, logits_edge, data_inference, clf, clf.inference.metrics)

    else:
        clf.results.OA_test = 0.0

Note: In my environment, I successfully reconstruct reconbench dataset. Also, in reconbench.yaml file, has_label is set to 1.

@raphaelsulzer
Copy link
Owner

raphaelsulzer commented Jan 30, 2022

Hi,
thank you for your interest in the work and apologies for the late response!

You can do one of two things:
(1) Delete the else statement that throws the error, insert if clf.inference.has_label: here and modify your config file such that inference: eval: []

or

(2) Pull the new master branch where I have incorporated the fix. You will then also have to redo your feature extraction, as I have changed this part of the code from using .txt to .npz files.

Hope this resolves your problem!

@yo6snap
Copy link
Author

yo6snap commented Feb 16, 2022

Thank you!

I applied your fix and now I'm able to reconstruct mesh from a custom dataset.

@yo6snap yo6snap closed this as completed Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants