title: Reading 4.8 GB Json file in Python
body: <pre><code>import json
  
  with open("reverseURL.json") as file:
      file2 = json.load(file)
  
  eagle = file2["eagle"]
  
  sky = file2["sky"]
  
  eagleAndSky = set(eagle).intersection(sky)
  
  print(eagleAndSky.pop())
  
  print(eagleAndSky.pop())
  </code></pre>
  
  <p>I am trying to run this code with a json file that is 4.8 gbs but everytime I run it, it freezes my computer, I don't know what to do. The json file contains tags that are used in photos as keys and for attributes they are image urls that contain that tag. The program works when I run it on the json file created from the test and validation set since they are small but when i run it on the json file from the training set, it freezes my computer since that file is huge like 4.8gb.</p>