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

UBUNTU met "UnboundLocalError: local variable 'test_data' referenced before assignment" when using "demo/d03" test if it's installing #542

Closed
GreameLee opened this issue May 7, 2024 · 5 comments

Comments

@GreameLee
Copy link

  • python version: 3.7
  • OS:ubuntu 18.4
  • CUDA version:12.2
@AnderBiguri
Copy link
Member

hi @GreameLee , can yo tell me the entire error (incuding line)?

@GreameLee
Copy link
Author

hi @GreameLee , can yo tell me the entire error (incuding line)?

Traceback (most recent call last):
File "d03_generateData.py", line 35, in
head = sample_loader.load_head_phantom(geo.nVoxel)
File "/home/user/anaconda3/envs/CT/lib/python3.7/site-packages/tigre/utilities/sample_loader.py", line 27, in load_head_phantom
image = test_data["img"].transpose(2, 1, 0).copy()
UnboundLocalError: local variable 'test_data' referenced before assignment

@AnderBiguri
Copy link
Member

@GreameLee have you installed the toolbox? seems that the data is missing, but this should only happens if you did not pip install . as the instructions suggest. Or did you do that, but still get this error??

@GreameLee
Copy link
Author

GreameLee commented May 8, 2024

@AnderBiguri Yes, I do all the instructions step by step and successfully did it and tried several times but still got this error. And when I go to the sample_loader.py file and put test_data as an absolute path of head.mat, it can run now. I guess there is a problem with the relative path.

@AnderBiguri
Copy link
Member

Thanks! for your own, that change should suffice to keep you going. I will investigate soon to see if I can find a fix that is general.

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