{"action":"opened","issue":{"url":"https://api.github.com/repos/junyanz/pytorch-CycleGAN-and-pix2pix/issues/358","repository_url":"https://api.github.com/repos/junyanz/pytorch-CycleGAN-and-pix2pix","labels_url":"https://api.github.com/repos/junyanz/pytorch-CycleGAN-and-pix2pix/issues/358/labels{/name}","comments_url":"https://api.github.com/repos/junyanz/pytorch-CycleGAN-and-pix2pix/issues/358/comments","events_url":"https://api.github.com/repos/junyanz/pytorch-CycleGAN-and-pix2pix/issues/358/events","html_url":"https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/issues/358","id":355156295,"node_id":"MDU6SXNzdWUzNTUxNTYyOTU=","number":358,"title":"AttributeError: 'Sequential' object has no attribute 'model'","user":{"login":"wangxiaodiu","id":1748165,"node_id":"MDQ6VXNlcjE3NDgxNjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1748165?v=4","gravatar_id":"","url":"https://api.github.com/users/wangxiaodiu","html_url":"https://github.com/wangxiaodiu","followers_url":"https://api.github.com/users/wangxiaodiu/followers","following_url":"https://api.github.com/users/wangxiaodiu/following{/other_user}","gists_url":"https://api.github.com/users/wangxiaodiu/gists{/gist_id}","starred_url":"https://api.github.com/users/wangxiaodiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangxiaodiu/subscriptions","organizations_url":"https://api.github.com/users/wangxiaodiu/orgs","repos_url":"https://api.github.com/users/wangxiaodiu/repos","events_url":"https://api.github.com/users/wangxiaodiu/events{/privacy}","received_events_url":"https://api.github.com/users/wangxiaodiu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-29T13:18:06Z","updated_at":"2018-08-29T13:18:06Z","closed_at":null,"author_association":"NONE","body":"I have some satellite(aerial) images, all are 256x256, and I put them in ** ~/temp/**, I want to translate them into map, so I downloaded the pretrained model and use the following command to test:\r\n\r\n`CUDA_VISIBLE_DEVICES=1 python test.py --dataroot ~/temp/ --dataset_mode single --resize_or_crop none --which_direction AtoB --model test --name sat2map_pretrained`\r\n\r\nBut I have got an AttributeError from python , here is the output:\r\n\r\n----------------- Options ---------------\r\n             aspect_ratio: 1.0\r\n                batchSize: 1\r\n          checkpoints_dir: ./checkpoints\r\n                 dataroot: /home/niu/temp/               \t[default: None]\r\n             dataset_mode: single\r\n              display_env: main\r\n               display_id: 1\r\n             display_port: 8097\r\n           display_server: http://localhost\r\n          display_winsize: 256\r\n                 fineSize: 256\r\n                  gpu_ids: 0\r\n                 how_many: 50\r\n                init_gain: 0.02\r\n                init_type: normal\r\n                 input_nc: 3\r\n                  isTrain: False                         \t[default: None]\r\n                 loadSize: 256\r\n         max_dataset_size: inf\r\n                    model: test\r\n\r\n▽\r\n             model_suffix:\r\n                 nThreads: 4\r\n               n_layers_D: 3\r\n                     name: sat2map_pretrained            \t[default: experiment_name]\r\n                      ndf: 64\r\n                      ngf: 64\r\n               no_dropout: True\r\n                  no_flip: False\r\n                     norm: instance\r\n                    ntest: inf\r\n                output_nc: 3\r\n                    phase: test\r\n           resize_or_crop: none                          \t[default: resize_and_crop]\r\n              results_dir: ./results/\r\n           serial_batches: False\r\n                   suffix:\r\n                  verbose: False\r\n          which_direction: AtoB\r\n              which_epoch: latest\r\n         which_model_netD: basic\r\n         which_model_netG: resnet_9blocks\r\n----------------- End -------------------\r\ndataset [SingleImageDataset] was created\r\ninitialize network with normal\r\nmodel [TestModel] was created\r\nloading the model from ./checkpoints/sat2map_pretrained/latest_net_G.pth\r\nTraceback (most recent call last):\r\n  File \"test.py\", line 19, in <module>\r\n    model.setup(opt)\r\n  File \"/home/niu/src/github/pytorch-CycleGAN-and-pix2pix/models/base_model.py\", line 43, in setup\r\n    self.load_networks(opt.which_epoch)\r\n  File \"/home/niu/src/github/pytorch-CycleGAN-and-pix2pix/models/base_model.py\", line 135, in load_networks\r\n    self.__patch_instance_norm_state_dict(state_dict, net, key.split('.'))\r\n  File \"/home/niu/src/github/pytorch-CycleGAN-and-pix2pix/models/base_model.py\", line 115, in __patch_instance_norm_state_dict\r\n    self.__patch_instance_norm_state_dict(state_dict, getattr(module, key), keys, i + 1)\r\n  File \"/home/niu/src/github/pytorch-CycleGAN-and-pix2pix/models/base_model.py\", line 115, in __patch_instance_norm_state_dict\r\n    self.__patch_instance_norm_state_dict(state_dict, getattr(module, key), keys, i + 1)\r\n  File \"/home/niu/anaconda3/envs/pix2pix/lib/python3.7/site-packages/torch/nn/modules/module.py\", line 518, in __getattr__\r\n    type(self).__name__, name))\r\nAttributeError: 'Sequential' object has no attribute 'model'\r\n\r\nI have looked into similat issues and googled for an hour but got nothing.\r\nCould someone help me with this? Thank you!"}}
{"actor":{"display_login":"wangxiaodiu"}}