質問編集履歴
3
追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -11,7 +11,13 @@
|
|
11
11
|
!pip install -U albumentations>=0.3.0 --user
|
12
12
|
!pip install -U git+https://github.com/albu/albumentations --no-cache-dir
|
13
13
|
|
14
|
+
・albumentationのversionの確認
|
15
|
+
import albumentations
|
16
|
+
import torch
|
17
|
+
print(albumentations.__version__)
|
18
|
+
>>>0.1.12
|
14
19
|
|
20
|
+
|
15
21
|
```python
|
16
22
|
train_dir = 'train'
|
17
23
|
val_dir = 'val'
|
2
補足
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
google colabo上で下のコードを実行したところ、
|
1
|
+
google colabo上で下のpythonコードを実行したところ、
|
2
2
|
|
3
3
|
AttributeError: module 'albumentations' has no attribute 'Lambda'
|
4
4
|
|
1
簡素にした
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,24 +1,11 @@
|
|
1
1
|
google colabo上で下のコードを実行したところ、
|
2
2
|
|
3
|
-
AttributeError Traceback (most recent call last)
|
4
|
-
<ipython-input-27-f20ab4f666d1> in <module>()
|
5
|
-
9 os.path.join(train_dir, 'masks'),
|
6
|
-
10 augmentation=get_training_augmentation(),
|
7
|
-
---> 11 preprocessing=get_preprocessing(preprocessing_fn),
|
8
|
-
12 classes=['cow1', 'cow2'],
|
9
|
-
13 )
|
10
|
-
|
11
|
-
<ipython-input-12-5cae0d01cb8e> in get_preprocessing(preprocessing_fn)
|
12
|
-
6 def get_preprocessing(preprocessing_fn):
|
13
|
-
7 _transform = [
|
14
|
-
----> 8 albu.Lambda(image=preprocessing_fn),
|
15
|
-
9 albu.Lambda(image=to_tensor, mask=to_tensor),
|
16
|
-
10 ]
|
17
|
-
|
18
3
|
AttributeError: module 'albumentations' has no attribute 'Lambda'
|
19
4
|
|
20
5
|
と表示されます。古いversionで対応されていない、もしくは新しいversionで対応してないというのが原因だと思うのですが、古いやつをアンインストールして、対応するversionをインストールするコマンドが知りたいです。
|
21
6
|
|
7
|
+
同じ問題を抱えて解決された方がいらしたら教えていただきたいです。
|
8
|
+
|
22
9
|
試したこと
|
23
10
|
・albumentationの更新
|
24
11
|
!pip install -U albumentations>=0.3.0 --user
|