Skip to content

Commit

Permalink
Linter fixed. KeyError handled with a warning message.
Browse files Browse the repository at this point in the history
  • Loading branch information
asyatrhl committed Oct 11, 2023
1 parent 0958fff commit e7c6981
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Create Venv
run: |
pyenv local 3.8.11
python3 -m venv venv --prompt ai8x-training
python -m venv venv --prompt ai8x-training
- name: Activate Venv
run: source venv/bin/activate
- name: Install Dependencies
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Create Venv
run: |
pyenv local 3.8.11
python3 -m venv venv --prompt ai8x-training
python -m venv venv --prompt ai8x-training
- name: Activate Venv
run: source venv/bin/activate
- name: Install Dependencies
Expand All @@ -89,7 +89,7 @@ jobs:
- name: Create Venv
run: |
pyenv local 3.8.11
python3 -m venv venv --prompt ai8x-training
python -m venv venv --prompt ai8x-training
- name: Activate Venv
run: source venv/bin/activate
- name: Install Dependencies
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
- name: Create Venv
run: |
pyenv local 3.8.11
python3 -m venv venv --prompt ai8x-training
python -m venv venv --prompt ai8x-training
- name: Activate Venv
run: source venv/bin/activate
- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion datasets/kws20.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __parse_augmentation(self, augmentation):
'Using defaults: [Min:-0.1, Max: 0.1]')
self.augmentation['shift'] = {'min': -0.1, 'max': 0.1}
if 'strech' not in augmentation:
print('No key `strech` in input augmentation dictionary! '
print('No key `stretch` in input augmentation dictionary! '
'Using defaults: [Min: 0.8, Max: 1.3]')
self.augmentation['strech'] = {'min': 0.8, 'max': 1.3}

Expand Down
1 change: 0 additions & 1 deletion regression/create_onnx_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def time_stamp():
modelsearch = element[-4][3:]
datasearch = element[-3].split('_')[0]
if datasearch == dataset.split('_')[0] and modelsearch == model:
# model_paths.remove(tar)
tar_path = tar
timestamp = time_stamp()
temp = (
Expand Down
10 changes: 6 additions & 4 deletions regression/create_test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def joining(lst):
try:
temp[i+1] = str(config[log_data][log_model]["epoch"])
except KeyError:
# Handle the KeyError by assigning a dummy value
temp[i+1] = "10"
print(f"\033[93m\u26A0\033[0m Warning: {temp[j+1]} model is" +
" missing information in test configuration files.")
continue

if '--deterministic' not in temp:
temp.insert(-1, '--deterministic')
Expand All @@ -98,8 +99,9 @@ def joining(lst):
path_data = config[log_data]["datapath"]
temp[i+1] = str(config[log_data][log_model]["epoch"])
except KeyError:
# Handle the KeyError by assigning a dummy value
path_data = "/data_ssd"
print(f"\033[93m\u26A0\033[0m Warning: {temp[j+1]} model is" +
" missing information in test configuration files.")
continue

temp.insert(-1, '--data ' + path_data)
temp.append("\n")
Expand Down
10 changes: 6 additions & 4 deletions regression/last_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ def dev_scripts(script_pth, output_file_pth):
try:
temp[i+1] = str(config[log_data][log_model]["epoch"])
except KeyError:
# Handle the KeyError by assigning a dummy value
temp[i+1] = "10"
print(f"\033[93m\u26A0\033[0m Warning: {temp[j+1]} model is" +
" missing information in test configuration files.")
continue

if '--deterministic' not in temp:
temp.insert(-1, '--deterministic')
Expand All @@ -106,8 +107,9 @@ def dev_scripts(script_pth, output_file_pth):
path_data = config[log_data]["datapath"]
temp[i+1] = str(config[log_data][log_model]["epoch"])
except KeyError:
# Handle the KeyError by assigning a dummy value
path_data = "/data_ssd"
print(f"\033[93m\u26A0\033[0m Warning: {temp[j+1]} model is" +
" missing information in test configuration files.")
continue

temp.insert(-1, '--data ' + path_data)
temp.append("\n")
Expand Down
2 changes: 1 addition & 1 deletion utils/object_detection_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def collate_fn(batch):
def check_target_exists(target_list):
"""
Checks whether any object exists in given target list
Object detection data laoders return target as
Object detection data loaders return target as
target[0]: boxes list
target[1]: labels list
For images without any objects, these lists are both empty
Expand Down

0 comments on commit e7c6981

Please sign in to comment.