Solved: Python Error: IndentationError: expected an indented block problem

Blogger Maotouhu () takes you to Go to New World? Blog homepage: Maotouhu’s blog “Complete Column of Interview Questions” Articles with pictures and texts Vivid images Simple and easy to learn! Everyone is welcome to step in~ “IDEA Development Cheats Column” Learn the common operations of IDEA and double your work efficiency~ “Master Golang in […]

Django attempts SSE log push and analysis of AssertionError: Hop-by-hop headers not allowed exception

Situation description In the near future, I plan to test Django’s support for log printing, which is usually done through websocket. I want to test the server-side push of SSE (Server-sent events), which is more concise. I found that there are errors during the process: Traceback (most recent call last): File “D:\Software\Anaconda3\lib\wsgiref\handlers.py”, line 137, in […]

Solving PermissionError: [Errno 13] Permission denied: ./data\mnist\train-images-idx3-ubyte

Table of Contents Problem Description wrong reason solution 1. Check file and directory permissions 2. Change the user or group to which the file belongs 3. Run the program with administrator privileges 4. Change file path 5. Use the os module to set file permissions in conclusion Data set composition Dataset content Dataset purpose Data […]

IDEA Rebuild project error: Information:java: java.lang.AssertionError: Value of x -1

Problem: java.lang.AssertionError: Value of x -1 Imitating the lombok tool, my enumgen tool is basically finished. After the release, it was overturned when it was ready to be put into production! After the company’s project emax-rpcapi-list relies on enumgen, when IDEA Rebuild Project or when maven package/install, an error occurs → Information: java: java.lang.AssertionError: Value […]

pytest pytest extended functions pycharm PermissionError: [Errno 13] Permission denied:

Table of Contents 1. pytest-html 1.1 PermissionError: [Errno 13] Permission denied: ‘D:\\software\python3\\anconda3\Lib\\site-packages\pytest_html\ __pycache__\tmp_ttoasov’ 1.2 Cause of error 2. Retry failed test cases 3. Parallel execution of use cases pytest-parallel 1. pytest-html The administrator opens Anaconda Prompt and enters: pip install pytest-html Check whether the installation is successful: 1.1 PermissionError: [Errno 13] Permission denied: ‘D:\software\python3\anconda3\ Lib\site-packages\pytest_html\__pycache__\tmp_ttoasov’ […]

[python] ssl.SSLCertVerificationError

1. Error message ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007) C:\Users\\ a.chen\AppData\Local\Microsoft\WindowsApps\python3.10.exe C:\Users\\ a.chen\PycharmProjects\python_for_work\ auto_click\for_jenkins_CN\build_now.py Traceback (most recent call last): File “C:\Users\\ a.chen\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\urllib3\ \connectionpool.py”, line 703, in urlopen httplib_response = self._make_request( File “C:\Users\\ a.chen\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\urllib3\ \connectionpool.py”, line 386, in _make_request self._validate_conn(conn) File “C:\Users\\ a.chen\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\urllib3\ \connectionpool.py”, line 1042, in _validate_conn conn. […]

The crash problem caused by onError/onSuccess execution of the observer task in DISPOSED state in RxJava

DoOnError is written in RxJava, but it still causes the application to crash. 1. Problem background 1.1 Crash stack 1.2 Write demo code to reproduce the same logic 2. Equivalent restoration of the problem – recurrence 2.1 Code location: io.reactivex.internal.operators.single.SingleCreate.Emitter#onError 3. Repair method 3.1 Solution 1: Set the global errorHandler, you need this one to […]

[Solved] Prompt error message: Solution for ZeroDivisionError: division by zero

When handwriting the Adaboost algorithm, the basic classifier G m ( x ) G_{m}(x) The coefficients of Gm?(x) are: alpha m = 1 2 log ? 1 ? e m e m \alpha_m=\frac{1}{2}\log\frac{1-e_m}{e_m} αm?=21?logem?1?em We use code to implement as: (only show part of the code) estimator.alpha=0.5*np.log((1-min_error)/(min_error)) preds=np.ones(np.shape(y)) negative_idx=(estimator.lable*X[:,estimator.feature_index]<estimator.lable*estimator.threshold) preds[negative_idx]=-1 w*=np.exp(-estimator.alpha*y*preds) w/=np.sum(w) self.estimators.append(estimator) But after […]

[Solved] Faster rcnn runs train.py and reports an error: AssertionError: Duplicate registrations for type ‘optimizer’

The error message is displayed as follows: Traceback (most recent call last): File “D:/Pycharm/try/Bearing-fault-Diagnosis-based-on-deep-learning-main/Bearing-fault-Diagnosis-based-on-deep-learning-main/sign/cnn.py”, line 3 , in from tensorflow import keras File “D:\Anaconda\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\__init__.py”, line 473, in keras._load() File “D:\Anaconda\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\util\lazy_loader.py”, line 41, in _load module = importlib.import_module(self.__name__) File “D:\Anaconda\Anaconda\envs\tensorflow\lib\importlib\__init__.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “D:\Anaconda\Anaconda\envs\tensorflow\lib\site-packages\keras\__init__.py”, line 25, in from keras import […]