I am currently calling an external API many times and downloading the response’s content from each call. I am using aiohttp and asyncio to speed up this process, but am having trouble figuring out how to separate the fetch functionality from the save functionality. Setup Currently, I am using the follow…
ValueError when using vae.fit in Keras
I am creating a vae model over the mnist dataset with hopes of plotting the loss function against the epochs. However I am experiencing some issues and was unable to find a solution online. During my imports I have the following imports (just to give some context to the code): I have also created a function c…
How do I interpret my BERT output from Huggingface Transformers for Sequence Classification and tensorflow?
Short TL;DR: I am using BERT for a sequence classification task and don’t understand the output I get. This is my first post, so please bear with me: I am using bert for a sequence classification task with 3 labels. To do this, I am using huggingface transformers with tensorflow, more specifically the T…
BERT DataLoader: Difference between shuffle=True vs Sampler?
I trained a DistilBERT model with DistilBertForTokenClassification on ConLL data fro predicting NER. Training seem to have completed with no problems but I have 2 problems during evaluation phase. I’m getting negative loss value During training, I used shuffle=True for DataLoader. But during evaluation,…
Issue with writing CSV in Python
I am reading and XLSX file. and looping over the rows and colums to remove all the clutter from the excel. When I print full_data_row it prints the string with , so that is correct. When i check my csv file. I get this as an ouput: header1,header2,header3 O,p,z,e,t, ,h,o,s,t,e,d, Answer csvwriter.writerow() e…
How can i get a dataframe to overwrite an existing excel in a specific cell using python pandas?
I have written the below which doesnt seem to be working. I am defining dataframe as d3, to be a columnn with 20 rows with the comment “my comment”. I am then trying to add that into an existing saved down excel doc in cell L2. The dataframe is printing and looks right in the IDE, but just doesnt …
Iterate over and index a list?
I am trying to iterate over a string that has many repeated characters in order to reorganize it into a list with each character replaced with a 3 letter code and its index+1. So I want to reorganize: Into: This is just an example string, and the final one will be ~300 characters long. Thanks for any advice! …
Selenium returns NoSuchElementException Error
I`m a newbie to python. Recently I got interested in Web Crawling. Today I got stuck in NoSuchElementException This is the webpage that i want to scrape. When I click the username that i erased, it returns box like this. Though I used the xpath that i copied from Chrome developer tool, it returns me NoSuchEle…
Install opencv-python module
I’m trying to install the opencv module without success, I think the problem is related to the version of python I’m using. Indeed I upgraded to the 3.9.1 version but when I’m trying to install the module, I still receive a warning referred to the old version of python I had (i.e. 2.7). How …
python winsound.playsound unable to find my sound file
I’ve been trying to add some music to the game I’ve been making. I’ve been trying to use winsound because it allows you to stop a sound mid-way through playing. The problem is that winsound seems unable to locate my sound file. I’ve tried using different modules such as the playsound m…