petercunha / Pine

:evergreen_tree: Aimbot powered by real-time object detection with neural networks, GPU accelerated with Nvidia. Optimized for use with CS:GO.
MIT License
441 stars 76 forks source link

IndexError: invalid index to scalar variable. #53

Open MrChoker opened 2 years ago

MrChoker commented 2 years ago

\OneDrive\Desktop\Pine-master\lib\pine.py", line 95, in start ln = [ln[i[0] - 1] for i in net.getUnconnectedOutLayers()] File "C:\Users\banni\OneDrive\Desktop\Pine-master\lib\pine.py", line 95, in ln = [ln[i[0] - 1] for i in net.getUnconnectedOutLayers()] IndexError: invalid index to scalar variable.

i cant install opencv-python-4.6.0.66 it gives me errors so that might be the issue

using
async-generator 1.10 attrs 21.4.0 certifi 2022.5.18.1 cffi 1.15.0 charset-normalizer 2.0.12 cryptography 37.0.2 fake-useragent 0.1.11 h11 0.13.0 idna 3.3 imutils 0.5.4 mss 6.1.0 numpy 1.22.4 opencv-python 4.6.0.66 outcome 1.1.0 pip 21.2.4 playsound 1.3.0 pycparser 2.21 pynput 1.7.6 pyOpenSSL 22.0.0 PySocks 1.7.1 python-dotenv 0.20.0 pywin32 304 requests 2.28.0 selenium 4.2.0 setuptools 58.1.0 six 1.16.0 sniffio 1.2.0 sortedcontainers 2.4.0 termcolor 1.1.0 trio 0.21.0 trio-websocket 0.9.2 urllib3 1.26.9 webdriver-manager 3.7.0 wsproto 1.1.0

Xatzis731 commented 2 years ago

I faced this issue as well but I finally resolved it. In order for you to do so, go to the lib folder on the pine-master file, open pine.py file and in line 95 and paste this line of code, instead of this already being here: " ln = [ln[i-1] for i in net.getUnconnectedOutLayers()] " This will fix your problem [https://imgur.com/o88YzzS]

ghost commented 2 years ago

I faced this issue as well but I finally resolved it. In order for you to do so, go to the lib folder on the pine-master file, open pine.py file and in line 95 and paste this line of code, instead of this already being here: " ln = [ln[i-1] for i in net.getUnconnectedOutLayers()] " This will fix your problem [https://imgur.com/o88YzzS]

wrong you don't simply remove code and hope it works down the road. you should unpack it and assign it to a variable first to get rid of the index error. Example: d = net.getUnconnectedOutLayers() # function that returns a list. qqq = d[0] # gets the first value of the previous list and assigns it to variable qqq. ln = [ln[qqq - 1] for i in net.getUnconnectedOutLayers()] # Then you place that value in the list comprehension.