index-error

IndexError: list index out of range in model.fit()

∥☆過路亽.° 提交于 2021-02-08 03:33:30
问题 I am new in using tensorflow. I am trying to train my network with images of shape (16*16). I have divided 3 grayscale images of 512*512 into 16*16 and appended all. so i have 3072*16*16. while training I am getting error. I am using jupyter notebook.Can anyone please help me? Here is the code import tensorflow as tf import numpy as np from numpy import newaxis import glob import os from PIL import Image,ImageOps import random from os.path import join import matplotlib.pyplot as plt from

IndexError when trying to update gensim's LdaModel

ⅰ亾dé卋堺 提交于 2020-12-26 11:04:20
问题 I am facing the following error when trying to update my gensim's LdaModel: IndexError: index 6614 is out of bounds for axis 1 with size 6614 I checked why were other people having this issue on this thread, but I am using the same dictionary from the beginning to the end, which was their error. As I have a big dataset, I am loading it chunk by chunk (using pickle.load). I am building the dictionary in this way, iteratively, thanks to this piece of code : fr_documents_lda = open("documents

IndexError when trying to update gensim's LdaModel

放肆的年华 提交于 2020-12-26 11:02:18
问题 I am facing the following error when trying to update my gensim's LdaModel: IndexError: index 6614 is out of bounds for axis 1 with size 6614 I checked why were other people having this issue on this thread, but I am using the same dictionary from the beginning to the end, which was their error. As I have a big dataset, I am loading it chunk by chunk (using pickle.load). I am building the dictionary in this way, iteratively, thanks to this piece of code : fr_documents_lda = open("documents

Input dimension for CrossEntropy Loss in PyTorch

空扰寡人 提交于 2020-05-15 21:21:13
问题 For a binary classification problem with batch_size = 1 , I have logit and label values using which I need to calculate loss. logit: tensor([0.1198, 0.1911], device='cuda:0', grad_fn=<AddBackward0>) label: tensor(1], device='cuda:0') # calculate loss loss_criterion = nn.CrossEntropyLoss() loss_criterion.cuda() loss = loss_criterion( b_logits, b_labels ) However, this always results in the following error, IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1) What

Input dimension for CrossEntropy Loss in PyTorch

北慕城南 提交于 2020-05-15 21:20:37
问题 For a binary classification problem with batch_size = 1 , I have logit and label values using which I need to calculate loss. logit: tensor([0.1198, 0.1911], device='cuda:0', grad_fn=<AddBackward0>) label: tensor(1], device='cuda:0') # calculate loss loss_criterion = nn.CrossEntropyLoss() loss_criterion.cuda() loss = loss_criterion( b_logits, b_labels ) However, this always results in the following error, IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1) What

Voronoi not plotting real time data tuple index out of range

╄→尐↘猪︶ㄣ 提交于 2020-05-09 17:15:07
问题 I'm trying to plot a voronoi diagram with real time data, but get the error: IndexError: tuple index out of range the code: data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes data = str(data, "utf-8") #convert bytes into string and fix the 'b' #data.decode("utf-8", errors="ignore") data = data.strip(" ").split(".") x = data[0] y = data[1] x = float(x.replace( ',', '.')) y = float(y.replace( ',', '.')) vor = Voronoi(x,y) The value of the data variable is like this: [b' 0,2036377.2

How to resolve positional index error in python while solving a condition in python?

我的梦境 提交于 2020-01-06 05:45:09
问题 I have the following data and I am trying the following code: Name Sensex_index Start_Date End_Date AAA 0.5 20/08/2016 25/09/2016 AAA 0.8 26/08/2016 29/08/2016 AAA 0.4 30/08/2016 31/08/2016 AAA 0.9 01/09/2016 05/09/2016 AAA 0.5 12/09/2016 22/09/2016 AAA 0.3 24/09/2016 29/09/2016 ABC 0.9 01/01/2017 15/01/2017 ABC 0.5 23/01/2017 30/01/2017 ABC 0.7 02/02/2017 15/03/2017 so what i do is, If the sensex index of (with same name) increases from lower index and moves to higher index, then the

Focus on second page form with Selenium

早过忘川 提交于 2020-01-05 01:35:40
问题 I am trying to fill out this form automatically using Selenium. The form consists out of two pages, which both need to be filled. One proceeds to the second page by clicking the orange button stating 'Weiter'. I have the following code, # load form into chrome, directly via its url ad_url = 'https://www.immobilienscout24.de/expose/97655130' form_url_end = '#/basicContact/email' url = ad_url + form_url_end browser = webdriver.Chrome() browser.get(url) # code which fills out first page

IndexError on huge list in Python

主宰稳场 提交于 2019-12-25 14:16:15
问题 Handling a list product of 100x100 size is fine in python : >>> import itertools >>> import numpy as numpy >>> nested_loop_iter = itertools.product(range(100), range(100)) >>> probs = np.fromiter(map(lambda x: x[0] *x[1], nested_loop_iter), dtype=int) >>> probs array([ 0, 0, 0, ..., 9603, 9702, 9801]) But when the size of the list product grows to 100,000 x 100,000, it throws an IndexError : >>> import itertools >>> import numpy as numpy >>> nested_loop_iter = itertools.product(range(100000),

IndexError on huge list in Python

痞子三分冷 提交于 2019-12-25 14:15:30
问题 Handling a list product of 100x100 size is fine in python : >>> import itertools >>> import numpy as numpy >>> nested_loop_iter = itertools.product(range(100), range(100)) >>> probs = np.fromiter(map(lambda x: x[0] *x[1], nested_loop_iter), dtype=int) >>> probs array([ 0, 0, 0, ..., 9603, 9702, 9801]) But when the size of the list product grows to 100,000 x 100,000, it throws an IndexError : >>> import itertools >>> import numpy as numpy >>> nested_loop_iter = itertools.product(range(100000),