Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
2k views

NotImplementedError: Module [ModuleList] is missing the required "forward" function

i get NotImplementedError when try to use Self-Attention on YOLO. class BertSelfAttention(nn.Module): def init(self, config): super().init() assert config["hidden_size"] % config["...
BlackShard's user avatar
1 vote
3 answers
132 views

Python list forward fill elements according to thresholds

I have a list a = ["Today, 30 Dec", "01:10", "02:30", "Tomorrow, 31 Dec", "00:00", "04:30", "05:30",...
Michael's user avatar
  • 367
-1 votes
1 answer
36 views

I don't understand the following error in my website relaying code that forwards the message from the website to the desired discord channel

I'm having trouble to understand the error with this code. It's all good and no errors whatsoever but when I run it says this: ` token = discord.utils.oauth_token(client_id, client_secret) ...
sombody.eth's user avatar
6 votes
1 answer
10k views

How to forward FastAPI requests to another server?

I have a FastAPI application for testing/development purposes. What I want is that any request that arrives to my app to automatically be sent, as is, to another app on another server, with exactly ...
amit's user avatar
  • 3,462
2 votes
1 answer
89 views

Moving forward in a panda dataframe looking for the first occurrence of multi-conditions with reset

I am having trouble with multi-conditions moving forward in a dataframe. Here's a simplification of my model: import pandas as pd import numpy as np df = pd.DataFrame({ 'date':pd.date_range(start=...
Michael Xxob's user avatar
-2 votes
1 answer
53 views

How do I can fix this problem of indented block?

This code does not work - I need help. I want to re-send a specific message. @events.register(events.NewMessage(chats='AAAAA')) async def me_handler(event): client = event.client if 'AAAAAAAA' in ...
Guillermo Marquez Fuentes's user avatar
1 vote
2 answers
3k views

Typeerror: 1 positional argument but 2 were given, torch.nn.linear takes

I am using EfficientNet to extract features and trying to add a fully connected layer to pre-trained model to reduce the dimension of the out-features from efficientnet to 512. I encountered the ...
ChengguiS.'s user avatar
-1 votes
1 answer
105 views

Python list identifying duplicat pairs [closed]

I have a list like below [3, 5, 6, 8, 1, 5, 3, 9, 0, 8, 6] I want to find out how many pairs in a list iterating in forward and reverse directions I want the output like the following statement 2 ...
Lara's user avatar
  • 49
1 vote
0 answers
30 views

retransmit mutlicast package with added XML data

I have an application that only listening and working with multicast-IP-Packages with XML content (maybe just need a XML header) Is there a python function to listen on specific multicast-address:port ...
2080robo's user avatar
3 votes
1 answer
10k views

Clarification for self.forward function in Python

I am not able to understand this sample_losses = self.forward(output, y) defined under the class Loss. From which "forward function" it is taking input as forward function is previously ...
Himanshu Gaur's user avatar
15 votes
4 answers
92k views

TypeError: Cannot interpret '4' as a data type

I am trying to learn Neural Network. Following is the code. I am getting the error 'TypeError: Cannot interpret '4' as a data type" Can anyone please help me identifying the mistake? import numpy ...
Himanshu Gaur's user avatar
1 vote
1 answer
3k views

Discord py forward messages(with embeds) sent on one channel to another and how to determine number of members in a server?

I want to forward messages sent on a particular channel to another channel based on number of reactions on 🔻 emoji reaction. The message has a few embeds and is being sent by the YAGPDB.xyz bot from ...
Nick Rogers's user avatar
0 votes
0 answers
157 views

Logistic regression cost calculation

I am working on the Assignment 2 of Prof.Andrew Ng's deep learning course. I have to compute the cost and the gradients (dw,db) of the logistic regression. I am clueless as to what is wrong with my ...
Joaquim's user avatar
  • 440
9 votes
2 answers
6k views

Pytorch: can we use nn.Module layers directly in forward() function?

Generally, In the constructor, we declare all the layers we want to use. In the forward function, we define how the model is going to be run, from input to output. My question is what if calling ...
Kuo's user avatar
  • 412
10 votes
2 answers
10k views

Difference between nn.MaxPool2d vs.nn.functional.max_pool2d?

Whats the difference between: nn.MaxPool2d(kernel_size, stride) and nn.functional.max_pool2d(t, kernel_size, stride)? The first one I define in the module and the second in the forward function? ...
gab's user avatar
  • 165
0 votes
1 answer
75 views

find match index group in python

What the simplest wayto determine which index group is searched in python example: desire value Yes, Yes, No value provided A = No, No, No B = Yes, No, No C = Yes, Yes, No We want to know which ...
Rizki Arif's user avatar
1 vote
0 answers
2k views

Basic numpy Adam implementation

since I am trying to understand the mechanisms onto which different neural network models are based, I decided to implement an Adam Optimizer using only numpy, without additional frameworks. When I ...
Sim1bet's user avatar
  • 33
2 votes
1 answer
216 views

Shift element by 2 when there is a change in value in a column and then forward fill using pandas

I have a pandas dataframe with date index and 100 columns of stock prices. I want to each stock, when ever there is a price change, there to be a lag of 2 and then after forward fill. Eg data of 2 ...
MysterioProgrammer91's user avatar
2 votes
2 answers
104 views

Escape "\" character in python string [need to avoid hexa encoding]

Need to pick IP address from this string str1 = '<\11.1.1.1\testdata>' When the following option implemented 1. reg = re.compile("^.*\/+([\d\.]+)/\+.*$",re.I).search mth = reg(...
Vaishali Pawar's user avatar
1 vote
1 answer
447 views

Flask 'in app' redirect aka forward

Is it possible to do 'in app' redirect in Flask app like in old poor Symfony 1? I mean if during of processing one request I decide to change my view function (by some condition) and I don't want to ...
Ivan Velichko's user avatar
1 vote
1 answer
2k views

how to add text to an email I'm forwarding using python/outlook without breaking original formatting?

I'm trying to open an email add some text to it and forward it using python windows extensions. This is what I have: import win32com.client outlook = win32com.client.Dispatch("Outlook.Application")....
user2617248's user avatar
3 votes
0 answers
4k views

how to forward an email after adding text with outlook/python?

I'm trying to open an email add some text to it and forward it using python windows extensions. This is what I have: import win32com.client outlook = win32com.client.Dispatch("Outlook.Application")....
user2617248's user avatar
0 votes
3 answers
5k views

Forward kinematics data modeling

I have built a simple robotic arm using 3 RC Servos and an Arduino. I just want to play around with it and learn something about robotics. Currently, I am trying to compute the position of the tip of ...
janismac's user avatar
  • 116
2 votes
1 answer
7k views

How to forward email using Python

First, let me say, I already know that this was asked at Forwarding an email with python smtplib already. The reason that I am posting something so closely related to that question is that I have ...
John Dorian's user avatar
2 votes
1 answer
616 views

How to get rid of forward slash in Python raw_input()

Beginner programmer here. So bear with me. I have a simple python program. print "How tall are you?", height = raw_input() print "So you're %r tall" %(height) If I enter the height as 6'6'' python ...
Jordan 's user avatar
  • 145
9 votes
2 answers
4k views

pyparsing, forward, and recursion

I'm using pyparsing to parse vcd (value change dump) files. Essentially, I want to read in the files, parse it into an internal dictionary, and manipulate the values. Without going into details on ...
RaytheonLiszt's user avatar
0 votes
1 answer
1k views

How do I forward a complete email without downloading attachments?

Hello (and thanks in advance!) I'm working in Python and I got IMAP and SMTP to work with my Gmail account. I now need to forward select messages to another account (after reading their body). How ...
Tal Weiss's user avatar
  • 8,999