Tag Archives: Problems encountered in the project

How to Solve Pytorch eval Stuck Error

Question

The single card training is very fast. When it comes to eval, it doesn’t move after running a batch, and there is no error.

Tried, still not moving

1, change the pin_memory of valid_loader to False. if it is True, it will automatically load the data into pin_memory, which speeds up the data
transfer speed to GPU.
2, change num_workers to 1, some people say too many workers may lead to multi-process interlock, can reduce or not

 

Final Solution:

valid_loader:
pin_memory = true # this is very important. Before, people on the Internet said that changing false might solve the problem. My experiment proved that if you do not work, you can run normally by changing back to true.
num_workers=4
batch_size=8

train_loader:
pin_memory=True
num_workers=4
batch_size = 8
these parameters are the same as valid_loader

In general, first of all, the pin_memory of valid_loader is kept True, which is well understood, the data is automatically loaded into pin_memory, which speeds up the data transfer to the GPU and naturally speeds up the inference process. Then, the number of workers and batch_size is reduced, and both valid_loader and train_loader are reduced. pin_memory of train_loader is also kept True.

SSM project interceptor infinite loop error [How to Solve]

Question:

In the SSM project, the implementation of non login interception has been endless loop and does not jump to the page

Solution:

Page not intercepted is not configured in the configuration file, resulting in an infinite loop

<!-- Configure interceptors -->
    <mvc:interceptors>
        <mvc:interceptor>
            <! -- Intercept all pages under the directory -->
            <mvc:mapping path="/**"/>
            <! -- mvc:exclude-mapping is another kind of interception that allows you to unintercept a page in your later tests, so that you don't have to use it in the
                LoginInterceptor's preHandler method inside to get the unintercepted request uri address (preferred)-->
            <mvc:exclude-mapping path="/login.html" />
            <bean class="org.westos.interceptor.LoginInterceptor"></bean>
        </mvc:interceptor>
    </mvc:interceptors>

Because a page may consist of multiple pages and JS, it must be intercepted correctly