0

I noticed that when using CameraInference object in a Python 3 script, if the script crashes, the script won't run properly after again without a reboot. Joy detector is off.

Anybody knows how to fix this? I looked up the source of CameraInference object and tried:

inference.close()

But that didn't work.

Should I reload the aiy vision kernel? Is is it a service problem?

service --status-all

Returns:

[ + ]  alsa-utils
 [ + ]  avahi-daemon
 [ + ]  bluetooth
 [ - ]  console-setup.sh
 [ + ]  cron
 [ + ]  dbus
 [ + ]  dhcpcd
 [ + ]  dnsmasq
 [ + ]  dphys-swapfile
 [ + ]  fake-hwclock
 [ - ]  hwclock.sh
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ + ]  lightdm
 [ + ]  motion
 [ + ]  networking
 [ - ]  nfs-common
 [ - ]  paxctld
 [ - ]  plymouth
 [ - ]  plymouth-log
 [ + ]  procps
 [ + ]  raspi-config
 [ - ]  rpcbind
 [ - ]  rsync
 [ + ]  rsyslog
 [ + ]  ssh
 [ - ]  sudo
 [ + ]  triggerhappy
 [ + ]  udev
 [ - ]  x11-common

And

lsmod

Returns

Module                  Size  Used by
aiy_adc                 4434  0
gpio_aiy_io             4226  2
industrialio           62643  1 aiy_adc
pwm_aiy_io              5084  0
cmac                    3134  1
rfcomm                 37873  8
bnep                   11917  2
leds_ktd202x            7349  0
aiy_io_i2c              6935  3 aiy_adc,gpio_aiy_io,pwm_aiy_io
hci_uart               21190  1
btbcm                   7885  1 hci_uart
bluetooth             375121  31 hci_uart,bnep,btbcm,rfcomm
usb_f_rndis            16991  2
u_ether                13511  1 usb_f_rndis
usb_f_acm               5895  2
u_serial               11113  3 usb_f_acm
spidev                  7034  0
aiy_vision             17078  0
brcmfmac              269539  0
brcmutil                9911  1 brcmfmac
cfg80211              527100  1 brcmfmac
rfkill                 21373  6 bluetooth,cfg80211
snd_soc_bcm2835_i2s     7999  0
regmap_mmio             3977  1 snd_soc_bcm2835_i2s
snd_soc_core          176256  1 snd_soc_bcm2835_i2s
snd_compress           10144  1 snd_soc_core
snd_pcm_dmaengine       6002  1 snd_soc_core
i2c_bcm2835             6433  0
snd_pcm                97825  3 snd_pcm_dmaengine,snd_soc_bcm2835_i2s,snd_soc_core
snd_timer              22706  1 snd_pcm
snd                    68784  4 snd_compress,snd_timer,snd_soc_core,snd_pcm
spi_bcm2835             7424  0
bcm2835_gpiomem         3791  2
uio_pdrv_genirq         3718  0
uio                    10166  1 uio_pdrv_genirq
fixed                   3029  0
uinput                  8753  0
cuse                    5918  2
fuse                   94600  4 cuse
pwm_soft               25304  0
i2c_dev                 6642  0
libcomposite           49651  10 usb_f_acm,usb_f_rndis
dwc2                  122113  0
udc_core               40452  6 usb_f_acm,u_serial,dwc2,u_ether,usb_f_rndis,libcomposite
ip_tables              12512  0
x_tables               20921  1 ip_tables
ipv6                  384613  32

Even after a fresh reboot I try the image_classification.py example and I get:

./image_classification.py --input cam.jpg

Traceback (most recent call last):
  File "./image_classification.py", line 48, in <module>
    main()
  File "./image_classification.py", line 42, in main
    inference.run(image), max_num_objects=5, object_prob_threshold=0.1)
  File "/opt/aiy/projects-python/src/aiy/vision/inference.py", line 98, in run
    return self._engine.image_inference(self._key, image, params)
  File "/opt/aiy/projects-python/src/aiy/vision/inference.py", line 317, in image_inference
    return self._communicate(request).inference_result
  File "/opt/aiy/projects-python/src/aiy/vision/inference.py", line 187, in _communicate
    response.ParseFromString(self._transport.send(request.SerializeToString()))
  File "/opt/aiy/projects-python/src/aiy/_drivers/_transport.py", line 33, in send
    return self._spicomm.transact(request)
  File "/opt/aiy/projects-python/src/aiy/_drivers/_spicomm.py", line 117, in transact
    raise SpicommOverflowError(PAYLOAD_SIZE)
aiy._drivers._spicomm.SpicommOverflowError

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.