Category "python"

shape '[1]' is invalid for input of size 2048

I am trying the extract features from images using resnet 152 model. It was working just fine with resnet18 model but when I try to use resnet152 model, it show

Dependencies issue while installing model card toolkit

Model Card --> Model Card toolkit I want to install a model card toolkit in my python virtual environment through this command: pip install model-card-toolk

Django: The QuerySet value for an exact lookup must be limited to one result using slicing

i am tring to access a page using a slug url, but i keep getting this error The QuerySet value for an exact lookup must be limited to one result using slicing.

how to see number of each line in text input of kivy?

There are some text editing softwares that show us the number of lines in order. like this: I want to have this effect in text input of kivy but i do not know

Convert SDR image to HDR with python openCV?

I wish to do the following in python with openCV to increase the brightness of an image. The aim is to turn an SDR photo into an HDR image (to increase the dyna

Plot variant abundance vs. time (e,g, of mutant strains) in python

Given [absolute] numbers for each of a number of variants over time, I would like to produce a plot like the following: Is there a function for this in Python

When i create Django Project with environment i have had a mistake line but when i deleted the environment file the line had disappeared !! Any Idea?

import os from django.core.wsgi import get_wsgi_application // Mistake in any import commands line but it is working os.environ.setdefault('DJANGO_SETTINGS_MODU

Python csv rearrange columns and calling from a dictionary (no pandas)

I need the code to rearrange the columns while changing the header names without using Pandas. I also need to omit some of the columns in the new csv file. Samp

How can I convert a return statement into a printable statement? [closed]

I am making a GFC (Greatest Common Factor) calculator with GUI, but my current code only works with a return statement, and tkinter doesn't ac

I've been trying to scrape profile pictures in Instagram using this code but i keep getting TypeError: 'NoneType' object is not subscriptable

import requests from bs4 import BeautifulSoup as bs User = input("input the username of the user "); url = 'https://instagram.com/' + User +'/' r = requests.get

I'd like to change the Keras to a pytorch, but I don't know how to build a neural network

The HAR dataset should be analyzed using LSTM and 1D CNN. I need to check the graph of the change in loss and check the confusion matrix. I don't know how to ma

How Can i Arrange a list of integers in python in txt file? [duplicate]

How can I arrange a list of integers in python in txt file? Example = I am having: ['45 USD\n', '68 USD\n', '32 USD\n', '894 USD\n'] I want t

How to explain these multiprocessing execution results?

I met such a problem: it has some mutually independent big tasks, and each task has some following mutually independent small tasks that depend on the result of

How to deal with missing libraries on Linux? [No Admin privileges and PIP is blocked]

For my work I need to write a GUI using PySide6 for a remote system. The OS is RHEL 7.9 and I have neither admin privileges nor PIP working (blocked by admins),

Generating list of hexagonal coordinates

I am gonna try to frame this in an understandable way but please let me know if further clarification is necessary. I am trying to create a list of hexagonal co

Compare 2 csv files and remove the common lines from 1st file | python

I want to compare 2 csv files master.csv and exclude.csv and remove all the matching lines based on column1 and write the final output in mater.csv file. master

Apply a weighted decay that changes over time in Python

I have a dataframe in Python that looks like the one below: I want to calculate the dnf_rate_weighted so that there's a 0.95 decay for each stage going back th

How to randomize shapes and colors using turtle python?

Can someone please help me with drawing random shapes in random colors using turtle python?

How to run Django admin site on Android

This is what am facing with with Django on my Android I'm using Pydroid on my phone. Python and Django are fully functional. But when I try to run Django admin

source to source transformation

I would like to transform input.js to output.js using string manipulation in python here is input.js let k=document.createElement("div"); k.innerHTML='<style