Skip to content

Commit 4d6e9dc

Browse files
authored
Fix pytorch 1.13 error due to 2D weights (#601)
Tested change works with both PyTorch 1.13.1 and Tensorflow 2.8.4
1 parent 66131df commit 4d6e9dc

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

.github/workflows/style.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,19 @@ on:
99

1010
jobs:
1111
style-check:
12-
runs-on: ubuntu-18.04
12+
runs-on: ubuntu-20.04
1313
steps:
1414
- name: Checkout source code
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616
with:
1717
submodules: true
1818
- name: Set up Python version
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: 3.6
2222
- name: Install dependencies
2323
run: |
24-
sudo apt-get install --yes clang-format-10
25-
python -m pip install -U yapf==0.30.0 nbformat pydocstyle==6.0.0
24+
python -m pip install -U clang-format==10.0.1.1 yapf==0.30.0 nbformat pydocstyle==6.0.0
2625
- name: Run style check
2726
run: |
2827
python ci/check_style.py

.github/workflows/ubuntu.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ on:
99

1010
jobs:
1111
ubuntu:
12-
runs-on: ubuntu-18.04
12+
runs-on: ubuntu-20.04
1313
strategy:
1414
fail-fast: false
1515
env:
1616
NPROC: 2
1717
steps:
1818
- name: Checkout source code
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2020
- name: Setup cache
21-
uses: actions/cache@v2
21+
uses: actions/cache@v3
2222
with:
2323
# Ref: https://github.com/apache/incubator-mxnet/pull/18459/files
2424
path: ~/.ccache
@@ -31,10 +31,10 @@ jobs:
3131
restore-keys: |
3232
${{ runner.os }}-ccache
3333
- name: Set up Python version
34-
uses: actions/setup-python@v2
34+
uses: actions/setup-python@v4
3535
with:
3636
python-version: "3.10"
37-
# Pre-installed 18.04 packages: https://git.io/JfHmW
37+
# Pre-installed packages: https://github.com/actions/runner-images/tree/main/images
3838
- name: Install ccache
3939
run: |
4040
sudo apt-get --yes install ccache

ml3d/datasets/utils/dataprocessing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def get_class_weights(num_per_class):
170170
weight = num_per_class / float(sum(num_per_class))
171171
ce_label_weight = 1 / (weight + 0.02)
172172

173-
return np.expand_dims(ce_label_weight, axis=0)
173+
return ce_label_weight
174174

175175
@staticmethod
176176
def invT(T):

0 commit comments

Comments
 (0)