I'm getting the following error in my code.
if self.time_step_period == self.the_num_of_job [self.curr_time]:
IndexError: list index out of range
I think this is trying to refer to self.curr_time outside the list self.the_num_of_job element. However, when this error occurs, the value of self.curr_time is 0, and self.the_num_of_job should have a value, so it is strange to get an error.
The source here is part of a function, but it works fine when running alone. However, the above error occurred during multi-thread processing.
from multiprocessing import Process from multiprocessing import Manager
I import and use the above. I'm not very familiar with multi-threaded code and I don't know why, but I'm using the multi-threaded processing that was originally completed, so there's nothing wrong with the way it is written. I'm editing the function by myself, so there is an error, but I don't understand the cause at all ... It might be a bit of a vague question, but I can't see the cause, so the entire code It is a situation that can not be raised, but anyway, there is a list index out of range even though it is within the range of the list, this is a possible cause from the fact that it is an error that occurs during multithread processing Will there be?
Answer # 1
Considering normally, there is a process where self.the_num_of_job is empty when multi-processed.
Self.the_num_of_job is split, forgotten to initialize, or element deleted.
Answer # 2
The only possible cause is accessing outside the list.
Let's write a coat to check it first
- python - about "could not retrieve index file" error
- [python] about aoj-0105 book index
- python - list index out of range error occurs for index 0
- python 3x - about iterative processing when the number of data of python scraping destination is unknown
- python - about the error "allocation of 536870912 exceeds 10% of system memory" when learning cnn
- about sum (axis=1) of python pandas
- about installing python on mac
- python - about tkinter line creation (?)
- about list behavior in python
- python - about a problem of satcoder agc39
- [python] about atcoder arc006b
- python - about keras maxpooling2d
- python - about the list when calling a function in another file
- python - [django] about access from another terminal in lan
- python: about list arguments
- about installing python
- python 3x - about matplotlib pylab
- about repeated operations in python for statement
- about errors in games made with python
- python - about variable errors
- python 3x - typeerror: 'method' object is not subscriptable
- python - you may need to restart the kernel to use updated packages error
- xcode - pod install [!] no `podfile 'found in the project directory
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- android studio - unresolved reference comes out in kotlin
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- python - importerror: cannot import name md5 error cannot be resolved