[Question / Suggestion] Potential bug in the sample_labeled_unlabeled_data. #119
Labels
bug
Something isn't working
enhancement
New feature or request
question
Further information is requested
Stale
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.I believe this is because of the if statement in line 83 of the sample_labeled_unlabeled_data function in semilearn/datasets/utils.py.
The default value for the variable
ulb_num_labels
isNone
(Nonetype), but the second half of the if statement returnsTrue
becauseNone != "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:
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.
The text was updated successfully, but these errors were encountered: