Comments (10)
I don't see this behavior. I don't have an RPi3A+ so it might be specific to that board.
from pwnagotchi.
will investigate more, this error seem the cause of not saving the brain.
[2023-05-04 13:06:51,433] [INFO] [ai] creating model ...
[2023-05-04 13:06:54,651] [INFO] [epoch 0] duration=00:00:48 slept_for=00:00:00 blind=0 sad=0 bored=0 inactive=1 active=0 peers=0 tot_bond=0.00 avg_bond=0.00 hops=0 missed=0 deauths=0 assocs=0 handshakes=0 cpu=25% mem=40% temperature=45C reward=-0.2
[2023-05-04 13:08:00,563] [INFO] [epoch 1] duration=00:01:05 slept_for=00:00:30 blind=1 sad=0 bored=0 inactive=2 active=0 peers=0 tot_bond=0.00 avg_bond=0.00 hops=0 missed=0 deauths=0 assocs=0 handshakes=0 cpu=26% mem=50% temperature=49C reward=-0.35
[2023-05-04 13:08:05,525] [INFO] [ai] model created:
[2023-05-04 13:08:05,526] [INFO] gamma: 0.99
[2023-05-04 13:08:05,527] [INFO] n_steps: 1
[2023-05-04 13:08:05,528] [INFO] vf_coef: 0.25
[2023-05-04 13:08:05,528] [INFO] ent_coef: 0.01
[2023-05-04 13:08:05,529] [INFO] max_grad_norm: 0.5
[2023-05-04 13:08:05,530] [INFO] learning_rate: 0.001
[2023-05-04 13:08:05,530] [INFO] alpha: 0.99
[2023-05-04 13:08:05,531] [INFO] epsilon: 1e-05
[2023-05-04 13:08:05,531] [INFO] verbose: 1
[2023-05-04 13:08:05,532] [INFO] lr_schedule: constant
[2023-05-04 13:08:06,662] [INFO] [ai] learning for 50 epochs ...
[2023-05-04 13:08:06,693] [ERROR] [ai] error while training (could not broadcast input array from shape (428,) into shape (1,503))
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/ai/train.py", line 177, in _ai_worker
self._model.learn(total_timesteps=epochs_per_episode, callback=self.on_ai_training_step)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 263, in learn
rollout = self.runner.run(callback)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/base_class.py", line 794, in runner
self._runner = self._make_runner()
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 110, in _make_runner
return A2CRunner(self.env, self, n_steps=self.n_steps, gamma=self.gamma)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 338, in __init__
super(A2CRunner, self).__init__(env=env, model=model, n_steps=n_steps)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/runners.py", line 31, in __init__
self.obs[:] = env.reset()
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/vec_env/dummy_vec_env.py", line 62, in reset
self._save_obs(env_idx, obs)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/vec_env/dummy_vec_env.py", line 92, in _save_obs
self.buf_obs[key][env_idx] = obs
ValueError: could not broadcast input array from shape (428,) into shape (1,503)
from pwnagotchi.
same error showing up and not saving the brain on version 1.7.6. Hardware used Raspberry Pi 3A+ (Same wifi chip with 3B+)
[2023-05-03 03:21:15,465] [INFO] waiting for 10s on channel 6 ...
[2023-05-03 03:21:25,630] [INFO] CHANNEL 1
[2023-05-03 03:21:25,688] [INFO] 3 access points on channel 1
[2023-05-03 03:21:25,833] [INFO] sending association frame to <hidden> (c6:70:ab:d8:47:0c ) on channel 1 [0 clients], -70 dBm...
[2023-05-03 03:21:26,033] [INFO] [ai] model created:
[2023-05-03 03:21:26,039] [INFO] gamma: 0.99
[2023-05-03 03:21:26,045] [INFO] n_steps: 1
[2023-05-03 03:21:26,051] [INFO] vf_coef: 0.25
[2023-05-03 03:21:26,057] [INFO] ent_coef: 0.01
[2023-05-03 03:21:26,063] [INFO] max_grad_norm: 0.5
[2023-05-03 03:21:26,069] [INFO] learning_rate: 0.001
[2023-05-03 03:21:26,075] [INFO] alpha: 0.99
[2023-05-03 03:21:26,081] [INFO] epsilon: 1e-05
[2023-05-03 03:21:26,087] [INFO] verbose: 1
[2023-05-03 03:21:26,093] [INFO] lr_schedule: constant
[2023-05-03 03:21:26,263] [INFO] [ai] learning for 50 epochs ...
[2023-05-03 03:21:26,290] [ERROR] [ai] error while training (could not broadcast input array from shape (428,) into shape (1,503))
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/ai/train.py", line 177, in _ai_worker
self._model.learn(total_timesteps=epochs_per_episode, callback=self.on_ai_training_step)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 263, in learn
rollout = self.runner.run(callback)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/base_class.py", line 794, in runner
self._runner = self._make_runner()
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 110, in _make_runner
return A2CRunner(self.env, self, n_steps=self.n_steps, gamma=self.gamma)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 338, in __init__
super(A2CRunner, self).__init__(env=env, model=model, n_steps=n_steps)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/runners.py", line 31, in __init__
self.obs[:] = env.reset()
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/vec_env/dummy_vec_env.py", line 62, in reset
self._save_obs(env_idx, obs)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/vec_env/dummy_vec_env.py", line 92, in _save_obs
self.buf_obs[key][env_idx] = obs
ValueError: could not broadcast input array from shape (428,) into shape (1,503)
from pwnagotchi.
I have the same error on the pi zero 2. I checked the brain.nn and brain.json were both there, rebooted and it went into auto mode. The pwnlog shows it creates an ai and overwrites the already trained version with a new one, starting training from scratch.
Also "sudo touch /root/.pwnagotchi-auto" doesn't work. The file is gone after a reboot... I used a brand new sd card to test
from pwnagotchi.
I have the same error on the pi zero 2. I checked the brain.nn and brain.json were both there, rebooted and it went into auto mode. The pwnlog shows it creates an ai and overwrites the already trained version with a new one, starting training from scratch.
Also "sudo touch /root/.pwnagotchi-auto" doesn't work. The file is gone after a reboot... I used a brand new sd card to test
It does work for me. If you look at the code that controls going into auto mode, it has multiple items it checks. One of those is the presence of that file, it if finds it, it is deleted but will still boot into AUTO next time. I consistently see my 2W boot into AUTO once I create the file.
from pwnagotchi.
But the log still says it creates a new nn file, even though there is a file present. I will try to collect the installation steps to recreate this problem
from pwnagotchi.
Just tested 1.7.7 and still encounter the same error also brain.nn & brain.json is not saving in /root directory. I think this is specific to 3A+ model since I don't encounter this on Zero 2W, I have 3B+ laying around I'll try later if I encounter this error in that board, they are technically same Wifi chip.
from pwnagotchi.
Same bug presents the exact same way on Pi4... I have it on a Pi3B running the build right now to see what it's output is. Will likely update later if issue presents there.
[2024-02-11 19:14:13,525] [INFO] deleting /root/.pwnagotchi-recovery
[2024-02-11 19:14:13,532] [INFO] creating new websocket...
[2024-02-11 19:14:13,658] [INFO] [epoch 214] duration=00:00:00 slept_for=00:00:00 blind=0 sad=0 bored=0 inactive=1 active=0 peers=0 tot_bond=0.00 avg_bond=0.00 hops=0 missed=0 deauths=0 assocs=0 handshakes=0 cpu=20% mem=0% temperature=39C reward=-0.0009302325581395349
[2024-02-11 19:14:29,444] [INFO] [ai] creating model ...
[2024-02-11 19:14:57,906] [INFO] [epoch 215] duration=00:00:44 slept_for=00:00:30 blind=0 sad=0 bored=0 inactive=2 active=0 peers=0 tot_bond=0.00 avg_bond=0.00 hops=6 missed=0 deauths=0 assocs=0 handshakes=0 cpu=34% mem=10% temperature=39C reward=0.002433862433862434
[2024-02-11 19:15:25,089] [INFO] [ai] model created:
[2024-02-11 19:15:25,089] [INFO] gamma: 0.99
[2024-02-11 19:15:25,089] [INFO] n_steps: 1
[2024-02-11 19:15:25,089] [INFO] vf_coef: 0.25
[2024-02-11 19:15:25,089] [INFO] ent_coef: 0.01
[2024-02-11 19:15:25,090] [INFO] max_grad_norm: 0.5
[2024-02-11 19:15:25,090] [INFO] learning_rate: 0.001
[2024-02-11 19:15:25,090] [INFO] alpha: 0.99
[2024-02-11 19:15:25,090] [INFO] epsilon: 1e-05
[2024-02-11 19:15:25,090] [INFO] verbose: 1
[2024-02-11 19:15:25,090] [INFO] lr_schedule: constant
[2024-02-11 19:15:25,103] [INFO] [ai] learning for 50 epochs ...
[2024-02-11 19:15:25,105] [ERROR] [ai] error while training (could not broadcast input array from shape (428,) into shape (1,503))
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/ai/train.py", line 177, in _ai_worker
self._model.learn(total_timesteps=epochs_per_episode, callback=self.on_ai_training_step)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 263, in learn
rollout = self.runner.run(callback)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/base_class.py", line 794, in runner
self._runner = self._make_runner()
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 110, in _make_runner
return A2CRunner(self.env, self, n_steps=self.n_steps, gamma=self.gamma)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 338, in __init__
super(A2CRunner, self).__init__(env=env, model=model, n_steps=n_steps)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/runners.py", line 31, in __init__
self.obs[:] = env.reset()
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/vec_env/dummy_vec_env.py", line 62, in reset
self._save_obs(env_idx, obs)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/vec_env/dummy_vec_env.py", line 92, in _save_obs
self.buf_obs[key][env_idx] = obs
ValueError: could not broadcast input array from shape (428,) into shape (1,503)
[2024-02-11 19:15:58,454] [INFO] [epoch 216] duration=00:01:00 slept_for=00:01:00 blind=0 sad=0 bored=0 inactive=3 active=0 peers=0 tot_bond=0.00 avg_bond=0.00 hops=7 missed=0 deauths=0 assocs=0 handshakes=0 cpu=0% mem=10% temperature=38C reward=0.002235023041474655
from pwnagotchi.
I have a RPi3 and I got a similar output:
[2024-02-15 15:49:08,240] [ERROR] [ai] error while training (could not broadcast input array from shape (428,) into shape (1,503))
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/ai/train.py", line 177, in _ai_worker
self._model.learn(total_timesteps=epochs_per_episode, callback=self.on_ai_training_step)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 263, in learn
rollout = self.runner.run(callback)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/base_class.py", line 794, in runner
self._runner = self._make_runner()
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 110, in _make_runner
return A2CRunner(self.env, self, n_steps=self.n_steps, gamma=self.gamma)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/a2c/a2c.py", line 338, in __init__
super(A2CRunner, self).__init__(env=env, model=model, n_steps=n_steps)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/runners.py", line 31, in __init__
self.obs[:] = env.reset()
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/vec_env/dummy_vec_env.py", line 62, in reset
self._save_obs(env_idx, obs)
File "/usr/local/lib/python3.7/dist-packages/stable_baselines/common/vec_env/dummy_vec_env.py", line 92, in _save_obs
self.buf_obs[key][env_idx] = obs
ValueError: could not broadcast input array from shape (428,) into shape (1,503)
from pwnagotchi.
I dug a bit more about that error. Some people suspected that it's due to the fact that some RPi3 support 5GHz and the extra channels break the AI calculation.
There were some ideas about missing dependencies (not enforced while installing) or version mismatchs. I tried all I could find but to no success. I still have the same error.
from pwnagotchi.
Related Issues (20)
- [BUG] Pwnagotchi wont stay open HOT 2
- [BUG] Always in MANU Mode HOT 3
- [BUG] Auto Mode won't start, stuck at "starting monitor interface" HOT 6
- No default controller available HOT 9
- Support e-Ink Waveshare 2.13" model G (silver Sticker) HOT 1
- [BUG] ERROR:root:There was an error processing the configuration file: 'utf-8' codec can't decode byte 0xb0 in position 8390: invalid start byte HOT 1
- [BUG] default user `pi` and password `raspbery` not working? HOT 24
- [BUG] mastodon plugin doesn't post updates HOT 2
- [BUG] can't access bettercap's webui when the pwnagotchi is plugged in PC and it's in MANU mode HOT 3
- [BUG] RPI4 Network is down HOT 3
- is the UPS lite V1.2 supported? how much does it change from the 1.1? HOT 6
- SSH credentials (default.toml) HOT 6
- Support USB Wifi Dongles (Realtek) HOT 4
- does/will this project support the orange pi zero 2W? HOT 4
- [BUG] Cannot update to v1.8.5 HOT 3
- [BUG] Hitting `shutdown`, `reboot` or `restart in auto mode` gives me an error HOT 4
- [BUG] waiting for bettercap API to be available ... in 1.8.4 HOT 2
- [BUG]Handshakes-m Plugin isnt functioning properly
- [BUG] Typo in plugin upgrade
- Bought a recent RPIZ2W - Not Working [BUG]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pwnagotchi.