質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
M5Stack

M5Stackは、小型のマイコンモジュールです。拡張モジュールが豊富に用意されており、センサと組み合わせることで測定機能を自由に追加することができます。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

1回答

1161閲覧

m5stick-V が頻繁にフリーズを起こし止まります。 同じ症状、解決策が分かる方教えてください!!

shosin__

総合スコア6

M5Stack

M5Stackは、小型のマイコンモジュールです。拡張モジュールが豊富に用意されており、センサと組み合わせることで測定機能を自由に追加することができます。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2020/12/06 02:33

編集2020/12/06 02:38

m5stick-VのV-trainingを実行したときに、フリーズを起こします。
学習データを取得するときの、カメラモード?の時はフリーズは起きないんですが、V-trainingを行っているときに起きます。

以下のようなエラーが出ますが、_boot.pyというファイルはなく、解決策が分からず困っています。

Traceback (most recent call last):
File "_boot.py", line 62, in <module>
File "_boot.py", line 62, in <module>
File "<string>", line 52, in <module>
ValueError: object not in sequence

コード

import image
import lcd
import sensor
import sys
import time
import KPU as kpu
from fpioa_manager import *

import KPU as kpu

lcd.init()
lcd.rotation(2)

try:
from pmu import axp192
pmu = axp192()
pmu.enablePMICSleepMode(True)
except:
pass

try:
img = image.Image("/sd/startup.jpg")
lcd.display(img)
except:
lcd.draw_string(lcd.width()//2-100,lcd.height()//2-4, "Error: Cannot find start.jpg", lcd.WHITE, lcd.RED)

task = kpu.load("/sd/270da14b7e06e658_mbnet10_quant.kmodel")

labels=["kami","kan1","kan2","pet1","pet2"] #You can check the numbers here to real names.

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_windowing((224, 224))
sensor.run(1)

lcd.clear()

detection_a = 0
detection_b = 0
detection_c = 0
detection_d = 0
detection_e = 0

while(True):
img = sensor.snapshot()
fmap = kpu.forward(task, img)
plist=fmap[:]
pmax=max(plist)
max_index=plist.index(pmax)
a = lcd.display(img)

max_label = "" if pmax > 0.95: max_label = labels[max_index] #lcd.draw_string(40, 60, "Accu:%.2f Type:%s"%(pmax, max_label)) if max_label == 'kami' : detection_a += 1 elif max_label == 'kan1': detection_b += 1 elif max_label == 'kan2' : detection_c += 1 elif max_label == 'pet1' : detection_d += 1 elif max_label == 'pet2' : detection_e += 1 if detection_a == 20 or detection_b == 20 or detection_c == 20 or detection_d == 20 or detection_e == 20: print(labels[max_index]) lcd.draw_string(40, 60, "Accu:%.2f Type:%s"%(pmax, max_label)) detection_a = 0 detection_b = 0 detection_c = 0 detection_d = 0 detection_e = 0 sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.set_windowing((224, 224)) sensor.run(1) lcd.clear()

a = kpu.deinit(task)

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

私も同様の事象で困っています。
V-Trainingにアップロードしてからメールで届いたモデルファイルやboot.pyをSDカードに入れて起動すると、対象画像がカメラに入ってくるとフリーズします。
それでMaixPy IDE上で実行してみるとフリーズしたときに、
「ValueError: object not in sequence」
のメッセージが出ます。

それで、boot.pyの中の推論部で以下のコードとなっていますが、斜体行がどうも該当部のようです。(カーソルが当たっています)

while(True):
img = sensor.snapshot()
fmap = kpu.forward(task, img)
plist=fmap[:]
pmax=max(plist)
__ max_index=plist.index(pmax)__
a = lcd.display(img)
if pmax > 0.95:
lcd.draw_string(40, 60, "Accu:%.2f Type:%s"%(pmax, labels[max_index].strip()))
a = kpu.deinit(task)

ということで回答にはなっておりませんがひとまず情報まで。失礼いたしました。

投稿2021/01/01 16:43

Mikun4619

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問