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

[Question / Suggestion] Potential bug in the sample_labeled_unlabeled_data. #119

Closed
bhoo-git opened this issue Jun 28, 2023 · 4 comments
Closed
Labels
bug Something isn't working enhancement New feature or request question Further information is requested Stale

Comments

@bhoo-git
Copy link

Bug

algorithm = get_algorithm(config, get_net_builder(config.net, from_name=False), tb_log=None, logger=None)

Running the following cell in step 2 of the Beginner_Example.ipynb notebook returns the following error:

TypeError: unsupported operand type(s) for %: 'NoneType' and 'int'. Here is a screenshot of the actual error message.

Screenshot 2023-06-28 113633

I believe this is because of the if statement in line 83 of the sample_labeled_unlabeled_data function in semilearn/datasets/utils.py.

error

The default value for the variable ulb_num_labels is None (Nonetype), but the second half of the if statement returns True because None != "None" is true due to the string-NoneType type difference.

I found that this issue can be resolved by breaking the two if statements into separate lines as below:

Screenshot 2023-06-28 114342

Reproduce the Bug

Python version: 3.7.16
Dependencies: installed using pip install -r requirements.txt after cloning the github repo.

Error Messages and Logs

Provided above.

@Hhhhhhao
Copy link
Collaborator

Thanks for reporting this bug.
Would simply replace the or operation with and operation resolve the problem?
Or more strictly, we can add constraints in arguments to prevent the ulb_num_labels to be string type.

@Hhhhhhao Hhhhhhao added bug Something isn't working question Further information is requested enhancement New feature or request labels Jul 14, 2023
@Hhhhhhao
Copy link
Collaborator

Fixed in PR #135

Hhhhhhao added a commit that referenced this issue Jul 20, 2023
* [Update] resolve requirements.txt conflicts

* [Fix] Fix mean teacher bug in #102

* [Fix] Fix DebiasPL bug

* [Fix] Fix potential sample data bug in #119

* [Update] Add auto issue/pr closer

* [Update] Update requirements.txt

* [Fix] Fix bug in #74

* [Fix] Fix amp lighting bug in #123

* [Fix] Fix notebook bugs

* [Update] release semilearn 0.3.1
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Aug 20, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

2 participants