Setting up a new session

使用pytorch训练模型时程序卡在Setting up a new session,应该是可视化visdom的问题,visdom默认端口号为8097,使用如下命令

python -m visdom.server

如果出现以下报错说明端口已经被占用:

OSError: [Errno 98] Address already in use

两种方法:更改端口号或者杀死使用该端口的进程

这里我使用的是后者

lsof -i:端口号

接着发现8097端口被其他python进程占用,kill掉

接着继续输入

python -m visdom.server

如果出现

It's Alive!
INFO:root:Application Started 
You can navigate to http://localhost:8097

说明该端口可用

(我是用pycharm连接的服务器,上述操作都是在Xshell中进行)

然后不要退出,在pycharm中点击运行代码就可以了

(如果是在Xshell中直接ctrl+z退出,接着运行代码还是会出错)

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Table of Contents Copyright Brief Table of Contents Table of Contents Praise for the Third Edition of Spring in Action Preface Acknowledgments About this Book 1. Core Spring Chapter 1. Springing into action 1.1. Simplifying Java development 1.1.1. Unleashing the power of POJOs 1.1.2. Injecting dependencies 1.1.3. Applying aspects 1.1.4. Eliminating boilerplate code with templates 1.2. Containing your beans 1.2.1. Working with an application context 1.2.2. A bean’s life 1.3. Surveying the Spring landscape 1.3.1. Spring modules 1.3.2. The Spring portfolio 1.4. What’s new in Spring 1.4.1. What was new in Spring 3.1? 1.4.2. What was new in Spring 3.2? 1.4.3. What’s new in Spring 4.0? 1.5. Summary Chapter 2. Wiring beans 2.1. Exploring Spring’s configuration options 2.2. Automatically wiring beans 2.2.1. Creating discoverable beans 2.2.2. Naming a component-scanned bean 2.2.3. Setting a base package for component scanning 2.2.4. Annotating beans to be automatically wired 2.2.5. Verifying automatic configuration 2.3. Wiring beans with Java 2.3.1. Creating a configuration class 2.3.2. Declaring a simple bean 2.3.3. Injecting with JavaConfig 2.4. Wiring beans with XML 2.4.1. Creating an XML configuration specification 2.4.2. Declaring a simple <bean> 2.4.3. Initializing a bean with constructor injection 2.4.4. Setting properties 2.5. Importing and mixing configurations 2.5.1. Referencing XML configuration in JavaConfig 2.5.2. Referencing JavaConfig in XML configuration 2.6. Summary Chapter 3. Advanced wiring 3.1. Environments and profiles 3.1.1. Configuring profile beans 3.1.2. Activating profiles 3.2. Conditional beans 3.3. Addressing ambiguity in autowiring 3.3.1. Designating a primary bean 3.3.2. Qualifying autowired beans 3.4. Scoping beans 3.4.1. Working with request and session scope 3.4.2. Declaring scoped proxies in XML 3.5. Runtime value injection 3.5.1. Injecting external values 3.5.2. Wiring with the Spring Expression Language 3.6. Summary Chapter 4. Aspect-oriented Spring 4.1. What is aspect-oriented programming? 4.1.1. Defining AOP terminology 4.1.2. Spring’s AOP support 4.2. Selecting join points with pointcuts 4.2.1. Writing pointcuts 4.2.2. Selecting beans in pointcuts 4.3. Creating annotated aspects 4.3.1. Defining an aspect 4.3.2. Creating around advice 4.3.3. Handling parameters in advice 4.3.4. Annotating introductions 4.4. Declaring aspects in XML 4.4.1. Declaring before and after advice 4.4.2. Declaring around advice 4.4.3. Passing parameters to advice 4.4.4. Introducing new functionality with aspects 4.5. Injecting AspectJ aspects 4.6. Summary 2. Spring on the web Chapter 5. Building Spring web applications 5.1. Getting started with Spring MVC 5.1.1. Following the life of a request 5.1.2. Setting up Spring MVC 5.1.3. Introducing the Spittr application 5.2. Writing a simple controller 5.2.1. Testing the controller 5.2.2. Defining class-level request handling 5.2.3. Passing model data to the view 5.3. Accepting request input 5.3.1. Taking query parameters 5.3.2. Taking input via path parameters 5.4. Processing forms 5.4.1. Writing a form-handling controller 5.4.2. Validating forms 5.5. Summary Chapter 6. Rendering web views 6.1. Understanding view resolution 6.2. Creating JSP views 6.2.1. Configuring a JSP-ready view resolver 6.2.2. Using Spring’s JSP libraries 6.3. Defining a layout with Apache Tiles views 6.3.1. Configuring a Tiles view resolver 6.4. Working with Thymeleaf 6.4.1. Configuring a Thymeleaf view resolver 6.4.2. Defining Thymeleaf templates 6.5. Summary Chapter 7. Advanced Spring MVC 7.1. Alternate Spring MVC configuration 7.1.1. Customizing DispatcherServlet configuration 7.1.2. Adding additional servlets and filters 7.1.3. Declaring DispatcherServlet in web.xml 7.2. Processing multipart form data 7.2.1. Configuring a multipart resolver 7.2.2. Handling multipart requests 7.3. Handling exceptions 7.3.1. Mapping exceptions to HTTP status codes 7.3.2. Writing exception-handling methods 7.4. Advising controllers 7.5. Carrying data across redirect requests 7.5.1. Redirecting with URL templates 7.5.2. Working with flash attributes 7.6. Summary Chapter 8. Working with Spring Web Flow 8.1. Configuring Web Flow in Spring 8.1.1. Wiring a flow executor 8.1.2. Configuring a flow registry 8.1.3. Handling flow requests 8.2. The components of a flow 8.2.1. States 8.2.2. Transitions 8.2.3. Flow data 8.3. Putting it all together: the pizza flow 8.3.1. Defining the base flow 8.3.2. Collecting customer information 8.3.3. Building an order 8.3.4. Taking payment 8.4. Securing web flows 8.5. Summary Chapter 9. Securing web applications 9.1. Getting started with Spring Security 9.1.1. Understanding Spring Security modules 9.1.2. Filtering web requests 9.1.3. Writing a simple security configuration 9.2. Selecting user details services 9.2.1. Working with an in-memory user store 9.2.2. Authenticating against database tables 9.2.3. Applying LDAP-backed authentication 9.2.4. Configuring a custom user service 9.3. Intercepting requests 9.3.1. Securing with Spring Expressions 9.3.2. Enforcing channel security 9.3.3. Preventing cross-site request forgery 9.4. Authenticating users 9.4.1. Adding a custom login page 9.4.2. Enabling HTTP Basic authentication 9.4.3. Enabling remember-me functionality 9.4.4. Logging out 9.5. Securing the view 9.5.1. Using Spring Security’s JSP tag library 9.5.2. Working with Thymeleaf’s Spring Security dialect 9.6. Summary 3. Spring in the back end Chapter 10. Hitting the database with Spring and JDBC 10.1. Learning Spring’s data-access philosophy 10.1.1. Getting to know Spring’s data-access exception hierarchy 10.1.2. Templating data access 10.2. Configuring a data source 10.2.1. Using JNDI data sources 10.2.2. Using a pooled data source 10.2.3. Using JDBC driver-based data sources 10.2.4. Using an embedded data source 10.2.5. Using profiles to select a data source 10.3. Using JDBC with Spring 10.3.1. Tackling runaway JDBC code 10.3.2. Working with JDBC templates 10.4. Summary Chapter 11. Persisting data with object-relational mapping 11.1. Integrating Hibernate with Spring 11.1.1. Declaring a Hibernate session factory 11.1.2. Building Spring-free Hibernate 11.2. Spring and the Java Persistence API 11.2.1. Configuring an entity manager factory 11.2.2. Writing a JPA-based repository 11.3. Automatic JPA repositories with Spring Data 11.3.1. Defining query methods 11.3.2. Declaring custom queries 11.3.3. Mixing in custom functionality 11.4. Summary Chapter 12. Working with NoSQL databases 12.1. Persisting documents with MongoDB 12.1.1. Enabling MongoDB 12.1.2. Annotating model types for MongoDB persistence 12.1.3. Accessing MongoDB with MongoTemplate 12.1.4. Writing a MongoDB repository 12.2. Working with graph data in Neo4j 12.2.1. Configuring Spring Data Neo4j 12.2.2. Annotating graph entities 12.2.3. Working with Neo4jTemplate 12.2.4. Creating automatic Neo4j repositories 12.3. Working with key-value data in Redis 12.3.1. Connecting to Redis 12.3.2. Working with RedisTemplate 12.3.3. Setting key and value serializers 12.4. Summary Chapter 13. Caching data 13.1. Enabling cache support 13.1.1. Configuring a cache manager 13.2. Annotating methods for caching 13.2.1. Populating the cache 13.2.2. Removing cache entries 13.3. Declaring caching in XML 13.4. Summary Chapter 14. Securing methods 14.1. Securing methods with annotations 14.1.1. Restricting method access with @Secured 14.1.2. Using JSR-250’s @RolesAllowed with Spring Security 14.2. Using expressions for method-level security 14.2.1. Expressing method access rules 14.2.2. Filtering method inputs and outputs 14.3. Summary 4. Integrating Spring Chapter 15. Working with remote services 15.1. An overview of Spring remoting 15.2. Working with RMI 15.2.1. Exporting an RMI service 15.2.2. Wiring an RMI service 15.3. Exposing remote services with Hessian and Burlap 15.3.1. Exposing bean functionality with Hessian/Burlap 15.3.2. Accessing Hessian/Burlap services 15.4. Using Spring’s HttpInvoker 15.4.1. Exposing beans as HTTP services 15.4.2. Accessing services via HTTP 15.5. Publishing and consuming web services 15.5.1. Creating Spring-enabled JAX-WS endpoints 15.5.2. Proxying JAX-WS services on the client side 15.6. Summary Chapter 16. Creating REST APIs with Spring MVC 16.1. Getting REST 16.1.1. The fundamentals of REST 16.1.2. How Spring supports REST 16.2. Creating your first REST endpoint 16.2.1. Negotiating resource representation 16.2.2. Working with HTTP message converters 16.3. Serving more than resources 16.3.1. Communicating errors to the client 16.3.2. Setting headers in the response 16.4. Consuming REST resources 16.4.1. Exploring RestTemplate’s operations 16.4.2. GETting resources 16.4.3. Retrieving resources 16.4.4. Extracting response metadata 16.4.5. PUTting resources 16.4.6. DELETEing resources 16.4.7. POSTing resource data 16.4.8. Receiving object responses from POST requests 16.4.9. Receiving a resource location after a POST request 16.4.10. Exchanging resources 16.5. Summary Chapter 17. Messaging in Spring 17.1. A brief introduction to asynchronous messaging 17.1.1. Sending messages 17.1.2. Assessing the benefits of asynchronous messaging 17.2. Sending messages with JMS 17.2.1. Setting up a message broker in Spring 17.2.2. Using Spring’s JMS template 17.2.3. Creating message-driven POJOs 17.2.4. Using message-based RPC 17.3. Messaging with AMQP 17.3.1. A brief introduction to AMQP 17.3.2. Configuring Spring for AMQP messaging 17.3.3. Sending messages with RabbitTemplate 17.3.4. Receiving AMQP messages
Table of Contents Preface 1 Chapter 1: Development using JoomlaCode.org and SVN 7 Setting up a JoomlaCode.org project 11 Managing members of a JoomlaCode.org project 16 Setting up JoomlaCode.org Subversion 17 Understanding the Subversion skeleton 20 Understanding revisions in Subversion 22 Understanding the Subversion process 24 Checking out a Subversion repository using TortoiseSVN 28 Editing a working copy using TortoiseSVN 31 Inspecting changes using TortoiseSVN 32 Updating a working copy and resolving conflicts using TortoiseSVN 34 Committing changes using TortoiseSVN 36 Exporting a working copy using TortoiseSVN 38 Chapter 2: Keeping Extensions Secure 39 Writing SQL safe queries 41 Writing SQL-safe LIKE string comparison queries 46 Using the token 48 Making a filename safe 52 Making a directory path safe 54 Making a path safe 56 Safely retrieving request data 58 Getting a value from an array 65 Chapter 3: Working with the Database 67 Executing a query 70 Loading the first cell from the result of a query 72 Loading the first record from a query 74 This material is copyright and is licensed for the sole use by Vadim Kudria on 4th October 2009 6352 108th St, , Forest Hills, , 11375 Download at WoweBook.Com ii Table of Contents Loading more than one record from a query 77 Handling DBO errors 79 Creating a JTable 81 Creating a new record using a JTable 84 Updating a record using a JTable 87 Reading an existing record using a JTable 88 Deleting a record using a JTable 88 Checking a record in and out (record locking) using a JTable 89 Modifying record ordering using a JTable 91 Publishing and unpublishing a record using a JTable 93 Incrementing a record hit counter using a JTable 95 Chapter 4: The Session and the User 97 Getting the session handler 98 Adding data to the session 99 Getting session data 102 Checking for session data 104 Checking the session token 105 Getting the user 105 Determining if the current user is a guest 107 Getting the user's name and username 108 Getting the user's group ID and type 109 Restricting a user's access using Public, Registered, and Special 111 Getting the user's parameters 113 Setting the user's parameters 115 Extending and editing user parameters 116 Sending an email to the user 119 Chapter 5: Multilingual Recipes 123 Creating a translation 126 Translating some text 130 Determining the character length of a UTF-8 string 133 Removing leading and trailing UTF-8 whitespace 134 Comparing UTF-8 strings 136 Finding a UTF-8 string in a UTF-8 string 137 Executing a regular expression on a UTF-8 string 139 Reversing a UTF-8 string 141 Extracting a substring from a UTF-8 string 142 Replacing occurrences of a UTF-8 string in a UTF-8 string 143 Accessing characters in a UTF-8 string by position 145 This material is copyright and is licensed for the sole use by Vadim Kudria on 4th October 2009 6352 108th St, , Forest Hills, , 11375 Download at WoweBook.Com iii Table of Contents Converting a string from one encoding to another 146 Creating a UTF-8 aware database installation script 147 Chapter 6: Interaction and Styling 149 Getting page and component parameters 150 Adding CSS to a page 152 Overriding component templates 154 Adding JavaScript to a page 155 Creating a modal window 157 Generating modal content 160 Updating an element using Ajax and MooTools 161 Updating an element based on a form using Ajax and MooTools 164 Providing an Ajax response from a component 166 Enabling pagination in a list of items 169 Chapter 7: Customizing the Document 173 Setting the document title 175 Setting the document generator 176 Setting the document description 176 Adding metadata to the document 177 Changing the document character set 178 Changing the document MIME type 180 Controlling client caching of responses 181 Creating a PDF in a component 183 Creating an RSS or Atom feed in a component 185 Outputting a RAW document from a component 190 Using a custom JDocument in a component (PHP 5 only) 192 Chapter 8: Customizing the Backend 199 Disabling the menu bar 200 Setting the toolbar title and icon 201 Adding common item manipulation buttons to the toolbar 203 Adding common itemized manipulation buttons to the toolbar 205 Adding custom buttons to the toolbar 207 Adding spacers and dividers to the toolbar 210 Adding a help system to a component 211 Creating a filter header for tabular data in an MVC component 213 Filtering tabular data in an MVC component 217 Creating toggle-enabled order column headers for tabular data in an MVC component 222 Ordering tabular data in an MVC component 224 This material is copyright and is licensed for the sole use by Vadim Kudria on 4th October 2009 6352 108th St, , Forest Hills, , 11375 Download at WoweBook.Com iv Table of Contents Chapter 9: Keeping it Extensible and Modular 227 Loading plugins 229 Invoking a plugin 230 Creating a Joomla! search plugin 232 Creating your own library and import function 237 Installing a plugin programmatically during a component installation 240 Managing categories the easy way 243 Defining JParameters using XML 245 Creating a JParameter object 247 Rendering a JParameter object 248 Saving JParameter data 251 Getting and setting values in a JParameter object 252 Defining your own JParameter type 254 Chapter 10: JObjects and Arrays 259 Getting a JObject property 262 Getting all of the public JObject properties 263 Setting a JObject property 263 Setting a batch of JObject properties 265 Reporting an error in a JObject 265 Getting an error from a JObject 267 Getting all errors from a JObject 268 Converting an object to an array 269 Converting an array to an object 270 Getting a column from a multidimensional array 272 Getting a value from an array 273 Casting all elements of an array to integers 274 Sorting an array of objects 275 Imploding an array 277 Chapter 11: Error Handling and Reporting 279 Raising an error-level J!error 281 Raising a warning-level J!error 283 Raising a notice-level J!error 285 Enqueuing a message 287 Changing the default J!error handling 290 Handling and raising a bespoke J!error 292 Logging errors and events using JLog 295 Throwing exceptions with PHP 5 298 Catching exceptions with PHP 5 300 This material is copyright and is licensed for the sole use by Vadim Kudria on 4th October 2009 6352 108th St, , Forest Hills, , 11375 Download at WoweBook.Com v Table of Contents Chapter 12: Files and Folders 305 Checking whether a file or folder exists 307 Reading a file 309 Deleting a file or folder 310 Copying a file or folder 312 Moving and renaming files and folders 314 Creating a folder 315 Uploading files to Joomla! 317 Reading a directory structure 322 Changing file and folder permissions 324 Index 327

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值