Skip to content

Commit 536dc9d

Browse files
Yanghan Wangfacebook-github-bot
Yanghan Wang
authored andcommitted
update CI on github
Summary: Fix some CIs Pull Request resolved: #5464 Reviewed By: vbourgin Differential Revision: D73599529 fbshipit-source-id: 9ff19736a2986ba801e211891a06acf9b5f1bc1f
1 parent 640e061 commit 536dc9d

File tree

4 files changed

+25
-20
lines changed

4 files changed

+25
-20
lines changed

.github/actions/install_linux_dep/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
shell: bash
1818
run: |
1919
# disable crash coredump, so unittests fail fast
20-
sudo systemctl stop apport.service
20+
sudo systemctl stop apport.service || true
2121
2222
pip install -U pip
2323

.github/workflows/workflow.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ jobs:
1212
# run on PRs, or commits to facebookresearch (not internal)
1313
if: ${{ github.repository_owner == 'facebookresearch' || github.event_name == 'pull_request' }}
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- name: Set up Python 3.9
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1818
with:
1919
python-version: 3.9
2020
- name: Install dependencies
2121
# flake8-bugbear flake8-comprehensions are useful but not available internally
2222
run: |
2323
python -m pip install --upgrade pip
2424
python -m pip install flake8==6.1.0 isort==4.3.21
25-
python -m pip install black==24.3.0
25+
python -m pip install black==24.4.2
2626
flake8 --version
2727
- name: Lint
2828
run: |
@@ -51,13 +51,13 @@ jobs:
5151
DETECTRON2_DATASETS: ~/.torch/datasets
5252
steps:
5353
- name: Checkout
54-
uses: actions/checkout@v2
54+
uses: actions/checkout@v4
5555
- name: Set up Python 3.8
56-
uses: actions/setup-python@v2
56+
uses: actions/setup-python@v4
5757
with:
5858
python-version: 3.8
5959
- name: Cache dependencies
60-
uses: actions/cache@v2
60+
uses: actions/cache@v4
6161
with:
6262
path: |
6363
${{ env.pythonLocation }}/lib/python3.8/site-packages
@@ -103,15 +103,15 @@ jobs:
103103
DETECTRON2_DATASETS: ~/.torch/datasets
104104
steps:
105105
- name: Checkout
106-
uses: actions/checkout@v2
106+
uses: actions/checkout@v4
107107

108108
- name: Set up Python 3.8
109-
uses: actions/setup-python@v2
109+
uses: actions/setup-python@v4
110110
with:
111111
python-version: 3.8
112112

113113
- name: Cache dependencies
114-
uses: actions/cache@v2
114+
uses: actions/cache@v4
115115
id: load-cache
116116
with:
117117
path: |
@@ -159,15 +159,15 @@ jobs:
159159
DETECTRON2_DATASETS: ~/.torch/datasets
160160
steps:
161161
- name: Checkout
162-
uses: actions/checkout@v2
162+
uses: actions/checkout@v4
163163

164164
- name: Set up Python 3.8
165-
uses: actions/setup-python@v2
165+
uses: actions/setup-python@v4
166166
with:
167167
python-version: 3.8
168168

169169
- name: Cache dependencies
170-
uses: actions/cache@v2
170+
uses: actions/cache@v4
171171
id: load-cache
172172
with:
173173
path: |
@@ -210,15 +210,15 @@ jobs:
210210
DETECTRON2_DATASETS: ~/.torch/datasets
211211
steps:
212212
- name: Checkout
213-
uses: actions/checkout@v2
213+
uses: actions/checkout@v4
214214

215215
- name: Set up Python 3.8
216-
uses: actions/setup-python@v2
216+
uses: actions/setup-python@v4
217217
with:
218218
python-version: 3.8
219219

220220
- name: Cache dependencies
221-
uses: actions/cache@v2
221+
uses: actions/cache@v4
222222
id: load-cache
223223
with:
224224
path: |

detectron2/data/datasets/cityscapes.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ def _cityscapes_files_to_dict(files, from_json, to_polygons):
138138
Returns:
139139
A dict in Detectron2 Dataset format.
140140
"""
141-
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import id2label, name2label
141+
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import (
142+
id2label,
143+
name2label,
144+
)
142145

143146
image_file, instance_id_file, _, json_file = files
144147

detectron2/evaluation/cityscapes_evaluation.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def evaluate(self):
9696
comm.synchronize()
9797
if comm.get_rank() > 0:
9898
return
99-
import deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalInstanceLevelSemanticLabeling as cityscapes_eval, deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalInstanceLevelSemanticLabeling
99+
import deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalInstanceLevelSemanticLabeling as cityscapes_eval # noqa: E501
100100

101101
self._logger.info("Evaluating results under {} ...".format(self._temp_dir))
102102

@@ -140,7 +140,9 @@ class CityscapesSemSegEvaluator(CityscapesEvaluator):
140140
"""
141141

142142
def process(self, inputs, outputs):
143-
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import trainId2label
143+
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import (
144+
trainId2label,
145+
)
144146

145147
for input, output in zip(inputs, outputs):
146148
file_name = input["file_name"]
@@ -161,7 +163,7 @@ def evaluate(self):
161163
return
162164
# Load the Cityscapes eval script *after* setting the required env var,
163165
# since the script reads CITYSCAPES_DATASET into global variables at load time.
164-
import deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalPixelLevelSemanticLabeling as cityscapes_eval, deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalPixelLevelSemanticLabeling
166+
import deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalPixelLevelSemanticLabeling as cityscapes_eval # noqa: E501
165167

166168
self._logger.info("Evaluating results under {} ...".format(self._temp_dir))
167169

0 commit comments

Comments
 (0)